summaryrefslogtreecommitdiff
path: root/app/bin/csnap.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 21:26:53 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 21:26:53 +0200
commitdf247efec654e512242e4f4f1b0212034f9e01fe (patch)
tree25c02e16957f3aa613af30c140fd8e8a3d52fda6 /app/bin/csnap.c
parentd0b6a8a4ec298024f14f704f9e40a6f9d324ccf3 (diff)
parenta5ade52caa489cf0a713e0f02b764000d203140e (diff)
Merge branch 'release/debian/1%5.2.0Beta2.1-1' into masterdebian/1%5.2.0Beta2.1-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;
}