mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 01:06:01 +08:00
Zooming is now centered around the mouse position.
This commit is contained in:
parent
fe2b7a9684
commit
e6530d87d6
@ -52,8 +52,10 @@ namespace XNodeEditor {
|
||||
case EventType.MouseMove:
|
||||
break;
|
||||
case EventType.ScrollWheel:
|
||||
var oldZoom = zoom;
|
||||
if (e.delta.y > 0) zoom += 0.1f * zoom;
|
||||
else zoom -= 0.1f * zoom;
|
||||
panOffset += (1 - oldZoom / zoom) * (WindowToGridPosition(e.mousePosition) + panOffset);
|
||||
break;
|
||||
case EventType.MouseDrag:
|
||||
if (e.button == 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user