mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 09:16:01 +08:00
Fixed draging the graph editor window around offseting nodes in the graph
This commit is contained in:
parent
ab87555c63
commit
5e182fe073
@ -68,11 +68,15 @@ namespace XNodeEditor {
|
||||
public void BeginZoomed() {
|
||||
GUI.EndGroup();
|
||||
|
||||
Rect position = new Rect(this.position);
|
||||
position.x = 0;
|
||||
position.y = topPadding;
|
||||
|
||||
Rect clippedArea = ScaleSizeBy(position, zoom, TopLeft(position));
|
||||
GUI.BeginGroup(clippedArea);
|
||||
|
||||
_prevGuiMatrix = GUI.matrix;
|
||||
Matrix4x4 translation = Matrix4x4.TRS(TopLeft(clippedArea), Quaternion.identity, Vector3.one);
|
||||
Matrix4x4 translation = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, Vector3.one);
|
||||
Matrix4x4 scale = Matrix4x4.Scale(new Vector3(1.0f / zoom, 1.0f / zoom, 1.0f));
|
||||
GUI.matrix = translation * scale * translation.inverse * GUI.matrix;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user