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

View File

@ -2162,8 +2162,15 @@ begin
Inc(camDragPos.x, x - camDragOld.x); Inc(camDragPos.x, x - camDragOld.x);
Inc(camDragPos.y, y - camDragOld.y); Inc(camDragPos.y, y - camDragOld.y);
vx := Round6(camDragValueX - (camDragPos.x * camCos - camDragPos.y * camSin) / 200); if GetKeyState(VK_MENU) < 0 then sc := 1000
vy := Round6(camDragValueY - (camDragPos.x * camSin + camDragPos.y * camCos) / 200); 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; cp.center[0] := vx;
txtCenterX.Text := FloatToStr(vx); txtCenterX.Text := FloatToStr(vx);