|
@@ -28,6 +28,9 @@ int parseOptions( int argc, char** argv ) {
|
28
|
28
|
arg.at( find ) = ' ';
|
29
|
29
|
}
|
30
|
30
|
int num = sscanf( arg.c_str(), "%*s %i", &borderSize );
|
|
31
|
+ if ( borderSize < 0 ) {
|
|
32
|
+ borderSize = 0;
|
|
33
|
+ }
|
31
|
34
|
if ( num != 1 ) {
|
32
|
35
|
printf( "Error parsing command arguments near %s\n", argv[i] );
|
33
|
36
|
printf( "Usage: -b=INT or --bordersize=INT\n" );
|
|
@@ -135,7 +138,6 @@ int main( int argc, char** argv ) {
|
135
|
138
|
}
|
136
|
139
|
case 1: {
|
137
|
140
|
selection = new is::Rectangle( xengine->m_mousex, xengine->m_mousey, 0, 0, borderSize, padding );
|
138
|
|
- selection->setPos( xengine->m_mousex, xengine->m_mousey );
|
139
|
141
|
xengine->addRect( selection );
|
140
|
142
|
state++;
|
141
|
143
|
break;
|
|
@@ -146,14 +148,13 @@ int main( int argc, char** argv ) {
|
146
|
148
|
break;
|
147
|
149
|
}
|
148
|
150
|
selection->setDim( xengine->m_mousex - selection->m_x, xengine->m_mousey - selection->m_y );
|
149
|
|
- // x and y offsets can indicate if the selection is inside-out, which lets us know which kind of cursor we need.
|
150
|
|
- int x = selection->m_xoffset;
|
151
|
|
- int y = selection->m_yoffset;
|
152
|
|
- if ( x == 0 && y == 0) {
|
|
151
|
+ bool x = selection->m_flippedx;
|
|
152
|
+ bool y = selection->m_flippedy;
|
|
153
|
+ if ( !x && !y ) {
|
153
|
154
|
xengine->setCursor( is::LowerRightCorner );
|
154
|
|
- } else if ( x && y == 0 ) {
|
|
155
|
+ } else if ( x && !y ) {
|
155
|
156
|
xengine->setCursor( is::LowerLeftCorner );
|
156
|
|
- } else if ( x == 0 && y ) {
|
|
157
|
+ } else if ( !x && y ) {
|
157
|
158
|
xengine->setCursor( is::UpperRightCorner );
|
158
|
159
|
} else {
|
159
|
160
|
xengine->setCursor( is::UpperLeftCorner );
|