preview panning fixed

This commit is contained in:
zueuk 2007-10-31 11:51:50 +00:00
parent 3b71479a61
commit d6d1f4e5f7
2 changed files with 12 additions and 4 deletions

View File

@ -170,6 +170,7 @@ object AdjustForm: TAdjustForm
Center = True
IncrementalDisplay = True
PopupMenu = QualityPopup
OnDblClick = PreviewImageDblClick
OnMouseDown = PreviewImageMouseDown
OnMouseMove = PreviewImageMouseMove
OnMouseUp = PreviewImageMouseUp
@ -1007,7 +1008,7 @@ object AdjustForm: TAdjustForm
end
object pnlMasterScale: TPanel
Left = 280
Top = 108
Top = 106
Width = 57
Height = 21
Cursor = crHandPoint
@ -1025,7 +1026,7 @@ object AdjustForm: TAdjustForm
end
object editPPU: TEdit
Left = 336
Top = 108
Top = 106
Width = 49
Height = 21
TabOrder = 3

View File

@ -2162,8 +2162,15 @@ begin
Inc(camDragPos.x, x - camDragOld.x);
Inc(camDragPos.y, y - camDragOld.y);
vx := Round6(camDragValueX - (camDragPos.x * camCos - camDragPos.y * camSin) / 200);
vy := Round6(camDragValueY - (camDragPos.x * camSin + camDragPos.y * camCos) / 200);
if GetKeyState(VK_MENU) < 0 then sc := 1000
else if GetKeyState(VK_CONTROL) < 0 then sc := 100
else if GetKeyState(VK_SHIFT) < 0 then sc := 1
else sc := 10;
sc := sc * cp.pixels_per_unit;
vx := Round6(camDragValueX - (camDragPos.x * camCos - camDragPos.y * camSin) / sc);
vy := Round6(camDragValueY - (camDragPos.x * camSin + camDragPos.y * camCos) / sc);
cp.center[0] := vx;
txtCenterX.Text := FloatToStr(vx);