Browse Source

made code more consistant

naelstrof 11 years ago
parent
commit
c675ecfb1b
2 changed files with 9 additions and 9 deletions
  1. 2
    2
      main.cpp
  2. 7
    7
      x.cpp

+ 2
- 2
main.cpp View File

152
                     // We pull the dimensions and positions from the selection rectangle.
152
                     // We pull the dimensions and positions from the selection rectangle.
153
                     // The selection rectangle automatically converts the positions and
153
                     // The selection rectangle automatically converts the positions and
154
                     // dimensions to absolute coordinates when we set them earilier.
154
                     // dimensions to absolute coordinates when we set them earilier.
155
-                    x = selection->m_x+selection->m_xoffset+borderSize;
156
-                    y = selection->m_y+selection->m_yoffset+borderSize;
155
+                    x = selection->m_x+selection->m_xoffset;
156
+                    y = selection->m_y+selection->m_yoffset;
157
                     w = selection->m_width;
157
                     w = selection->m_width;
158
                     h = selection->m_height;
158
                     h = selection->m_height;
159
                     // Delete the rectangle.
159
                     // Delete the rectangle.

+ 7
- 7
x.cpp View File

264
     unsigned long valueMask = CWBackPixmap | CWBackPixel | CWOverrideRedirect | CWColormap;
264
     unsigned long valueMask = CWBackPixmap | CWBackPixel | CWOverrideRedirect | CWColormap;
265
 
265
 
266
     // Create the window offset by our generated offsets (see constrain( float, float ))
266
     // Create the window offset by our generated offsets (see constrain( float, float ))
267
-    m_window = XCreateWindow( xengine->m_display, xengine->m_root, m_x+m_xoffset, m_y+m_yoffset, m_width+m_border*2, m_height+m_border*2,
267
+    m_window = XCreateWindow( xengine->m_display, xengine->m_root, m_x+m_xoffset-m_border, m_y+m_yoffset-m_border, m_width+m_border*2, m_height+m_border*2,
268
                               0, CopyFromParent, InputOutput,
268
                               0, CopyFromParent, InputOutput,
269
                               CopyFromParent, valueMask, &attributes );
269
                               CopyFromParent, valueMask, &attributes );
270
 
270
 
288
     if ( m_border == 0 ) {
288
     if ( m_border == 0 ) {
289
         return;
289
         return;
290
     }
290
     }
291
-    XMoveWindow( xengine->m_display, m_window, m_x+m_xoffset, m_y+m_yoffset );
291
+    XMoveWindow( xengine->m_display, m_window, m_x+m_xoffset-m_border, m_y+m_yoffset-m_border );
292
 }
292
 }
293
 
293
 
294
 void slop::Rectangle::setDim( int w, int h ) {
294
 void slop::Rectangle::setDim( int w, int h ) {
304
 
304
 
305
     // Change the window size and location to our generated offsets (see constrain( float, float ))
305
     // Change the window size and location to our generated offsets (see constrain( float, float ))
306
     XResizeWindow( xengine->m_display, m_window, m_width+m_border*2, m_height+m_border*2 );
306
     XResizeWindow( xengine->m_display, m_window, m_width+m_border*2, m_height+m_border*2 );
307
-    XMoveWindow( xengine->m_display, m_window, m_x+m_xoffset, m_y+m_yoffset );
307
+    XMoveWindow( xengine->m_display, m_window, m_x+m_xoffset-m_border, m_y+m_yoffset-m_border );
308
     // Regenerate our hole
308
     // Regenerate our hole
309
     XRectangle rect;
309
     XRectangle rect;
310
     rect.x = rect.y = 0;
310
     rect.x = rect.y = 0;
380
     }
380
     }
381
     if ( w < 0 ) {
381
     if ( w < 0 ) {
382
         m_flippedx = true;
382
         m_flippedx = true;
383
-        m_xoffset = w - pad - m_border;
383
+        m_xoffset = w - pad;
384
         m_width = -w + pad*2;
384
         m_width = -w + pad*2;
385
     } else {
385
     } else {
386
         m_flippedx = false;
386
         m_flippedx = false;
387
-        m_xoffset = -pad - m_border;
387
+        m_xoffset = -pad;
388
         m_width = w + pad*2;
388
         m_width = w + pad*2;
389
     }
389
     }
390
 
390
 
394
     }
394
     }
395
     if ( h < 0 ) {
395
     if ( h < 0 ) {
396
         m_flippedy = true;
396
         m_flippedy = true;
397
-        m_yoffset = h - pad - m_border;
397
+        m_yoffset = h - pad;
398
         m_height = -h + pad*2;
398
         m_height = -h + pad*2;
399
     } else {
399
     } else {
400
         m_flippedy = false;
400
         m_flippedy = false;
401
-        m_yoffset = -pad - m_border;
401
+        m_yoffset = -pad;
402
         m_height = h + pad*2;
402
         m_height = h + pad*2;
403
     }
403
     }
404
 }
404
 }