Browse Source

Fixed a bug where a single pixel isn't accounted for when selecting the entire screen. Upped version for previous changes

naelstrof 9 years ago
parent
commit
a8f1e5cd57
3 changed files with 7 additions and 2 deletions
  1. 1
    1
      CMakeLists.txt
  2. 1
    1
      README.md
  3. 5
    0
      src/main.cpp

+ 1
- 1
CMakeLists.txt View File

3
 project( "slop" )
3
 project( "slop" )
4
 set( slop_VERSION_MAJOR 4 )
4
 set( slop_VERSION_MAJOR 4 )
5
 set( slop_VERSION_MINOR 2 )
5
 set( slop_VERSION_MINOR 2 )
6
-set( slop_VERSION_PATCH 18 )
6
+set( slop_VERSION_PATCH 19 )
7
 
7
 
8
 set( CMAKE_OPENGL_SUPPORT FALSE CACHE BOOL "Whether or not to compile with OpenGL, shaders, magnification, and theming support." )
8
 set( CMAKE_OPENGL_SUPPORT FALSE CACHE BOOL "Whether or not to compile with OpenGL, shaders, magnification, and theming support." )
9
 
9
 

+ 1
- 1
README.md View File

115
 help
115
 help
116
 ----
116
 ----
117
 ```text
117
 ```text
118
-slop v4.2.18
118
+slop v4.2.19
119
 
119
 
120
 Copyright (C) 2014 Dalton Nell, Slop Contributors
120
 Copyright (C) 2014 Dalton Nell, Slop Contributors
121
 (https://github.com/naelstrof/slop/graphs/contributors)
121
 (https://github.com/naelstrof/slop/graphs/contributors)

+ 5
- 0
src/main.cpp View File

54
 }
54
 }
55
 
55
 
56
 int printSelection( std::string format, bool cancelled, int x, int y, int w, int h, int window ) {
56
 int printSelection( std::string format, bool cancelled, int x, int y, int w, int h, int window ) {
57
+    //Impossible to select nothing
58
+    if (!cancelled) {
59
+        w += 1;
60
+        h += 1;
61
+    }
57
     size_t pos = 0;
62
     size_t pos = 0;
58
     while ( ( pos = format.find( "%", pos ) ) != std::string::npos ) {
63
     while ( ( pos = format.find( "%", pos ) ) != std::string::npos ) {
59
         if ( pos + 1 > format.size() ) {
64
         if ( pos + 1 > format.size() ) {