summaryrefslogtreecommitdiff
path: root/app/bin/csnap.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-08 11:53:00 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-08 11:53:00 +0200
commitb623f5953691b2a0614e6f1f4def86bdbb9a4113 (patch)
tree18102bd36f7e22eb2ba2b9f880e4cb29346f4cb8 /app/bin/csnap.c
parent359b557176b9bb2ff1aed2082641eed39c358d0d (diff)
New upstream version 5.2.0Beta2.1upstream/5.2.0Beta2.1
Diffstat (limited to 'app/bin/csnap.c')
-rw-r--r--app/bin/csnap.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/app/bin/csnap.c b/app/bin/csnap.c
index 4c4d948..eb58bc4 100644
--- a/app/bin/csnap.c
+++ b/app/bin/csnap.c
@@ -209,7 +209,7 @@ EXPORT void DrawGrid(
cross0_bm = wDrawBitMapCreate( mainD.d, cross0_width, cross0_height, 2, 2, cross0_bits );
#endif
- wSetCursor( wCursorWait );
+ wSetCursor( mainD.d, wCursorWait );
dpi = D->dpi/D->scale;
Gdx = cos(D2R(Gangle));
Gdy = sin(D2R(Gangle));
@@ -329,7 +329,7 @@ EXPORT void DrawGrid(
done:
- wSetCursor( wCursorNormal );
+ wSetCursor( mainD.d, defaultCursor );
}
@@ -368,45 +368,41 @@ EXPORT STATUS_T GridAction(
switch (action) {
case C_DOWN:
pos1 = pos;
- DrawBigCross( pos1, *angle );
return C_CONTINUE;
case C_MOVE:
- DrawBigCross( pos1, *angle );
*orig = pos1 = pos;
- DrawBigCross( pos1, *angle );
return C_CONTINUE;
case C_UP:
- DrawBigCross( pos1, *angle );
*orig = pos1;
return C_CONTINUE;
case C_RDOWN:
pos0 = pos1 = pos;
oldAngle = newAngle = *angle;
- DrawBigCross( pos0, newAngle );
return C_CONTINUE;
case C_RMOVE:
if ( FindDistance(pos0, pos) > 0.1*mainD.scale ) {
- DrawBigCross( pos0, newAngle );
pos1 = pos;
newAngle = FindAngle( pos0, pos1 );
if (angleSystem!=ANGLE_POLAR)
newAngle = newAngle-90.0;
newAngle = NormalizeAngle( floor( newAngle*10.0 ) / 10.0 );
*angle = newAngle;
- DrawBigCross( pos0, newAngle );
}
return C_CONTINUE;
case C_RUP:
- DrawBigCross( pos0, newAngle );
Rotate( orig, pos0, newAngle-oldAngle );
*orig = pos0;
*angle = newAngle;
return C_CONTINUE;
+
+ case C_REDRAW:
+ DrawBigCross( *orig, *angle );
+ break;
}
return C_CONTINUE;
}
@@ -564,8 +560,7 @@ static void RedrawGrid( void )
if (grid.Show != oldGrid.Show ||
GridChanged() ) {
wDrawDelayUpdate( tempD.d, TRUE );
- DrawASnapGrid( &oldGrid, &tempD, mapD.size, TRUE );
- DrawASnapGrid( &grid, &tempD, mapD.size, TRUE );
+ MainRedraw(); // RedrawGrid
wDrawDelayUpdate( tempD.d, FALSE );
}
}
@@ -674,12 +669,9 @@ static void GridDlgUpdate(
GridButtonUpdate( CHK_SHOW );
break;
default:
- wDrawDelayUpdate( tempD.d, TRUE );
- DrawASnapGrid( &oldGrid, &tempD, mapD.size, TRUE );
ParamLoadData( &gridPG );
GridButtonUpdate( 0 );
- DrawASnapGrid( &grid, &tempD, mapD.size, TRUE );
- wDrawDelayUpdate( tempD.d, FALSE );
+ MainRedraw(); // GridDlgUpdate
}
}
@@ -688,9 +680,8 @@ static void SnapGridRotate( void * pangle )
{
ANGLE_T angle = (ANGLE_T)(long)pangle;
wDrawDelayUpdate( tempD.d, TRUE );
- DrawASnapGrid( &oldGrid, &tempD, mapD.size, TRUE );
grid.Orig = cmdMenuPos;
- grid.Angle += angle;
+ grid.Angle += angle/1000;
oldGrid = grid;
DrawASnapGrid( &grid, &tempD, mapD.size, TRUE );
wDrawDelayUpdate( tempD.d, FALSE );
@@ -719,12 +710,12 @@ EXPORT STATUS_T CmdGrid(
return C_CONTINUE;
case C_REDRAW:
- return C_TERMINATE;
+ DrawBigCross( grid.Orig, grid.Angle );
+ return C_CONTINUE;
case C_CANCEL:
grid = oldGrid;
wHide( gridW );
- MainRedraw();
return C_TERMINATE;
case C_OK:
@@ -767,6 +758,7 @@ EXPORT STATUS_T CmdGrid(
return rc;
case C_CMDMENU:
+ menuPos = pos;
wMenuPopupShow( snapGridPopupM );
break;
}