Skip to content

Commit cc58565

Browse files
committed
Enable an otherwise nonexistant pan mode in the UI. (fixes #2)
Thanks to @ryancnelson for the tip. (makerbot/ReplicatorG#284) The logic was setting ROTATE_VIEW for *everything* unconditionally, this changes it such that: * on a mac, when shift is held down and a mouse1 drag happens, it sets TRANSLATE_VIEW * on a !mac, when a button3 drag happens, it sets TRANSLATE_VIEW.
1 parent 40bbb03 commit cc58565

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/replicatorg/app/ui/modeling/Tool.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public AxisControl(String title, JPanel parent, double initial) {
3636
if (Tool.this instanceof ChangeListener) {
3737
spinner.addChangeListener((ChangeListener)Tool.this);
3838
}
39-
}
39+
}
4040
}
4141

4242
public JButton createToolButton(String text, String iconPath) {
@@ -58,20 +58,20 @@ public CoordinateControl(JPanel parent, Point3d coordinate) {
5858
axes[1] = new AxisControl("Y",parent, coordinate.y);
5959
axes[2] = new AxisControl("Z",parent, coordinate.z);
6060
}
61-
61+
6262
public void update() {
6363
axes[0].model.setValue(new Double(coordinate.x));
6464
axes[1].model.setValue(new Double(coordinate.y));
6565
axes[2].model.setValue(new Double(coordinate.z));
6666
}
6767
}
68-
68+
6969
abstract String getTitle();
7070
abstract String getButtonName();
7171
abstract Icon getButtonIcon();
7272
abstract String getInstructions();
7373
abstract JPanel getControls();
74-
74+
7575
final protected ToolPanel parent;
7676
public Tool(ToolPanel parent) {
7777
this.parent = parent;
@@ -83,13 +83,13 @@ public Tool(ToolPanel parent) {
8383
public void mouseDragged(MouseEvent e) {
8484
if (startPoint == null) return;
8585
Point p = e.getPoint();
86-
DragMode mode = DragMode.ROTATE_VIEW;
86+
DragMode mode = DragMode.ROTATE_VIEW;
8787
if (Base.isMacOS()) {
8888
if (button == MouseEvent.BUTTON1 && !e.isShiftDown()) { mode = DragMode.ROTATE_VIEW; }
89-
else if (button == MouseEvent.BUTTON1 && e.isShiftDown()) { mode = DragMode.ROTATE_VIEW; }
89+
else if (button == MouseEvent.BUTTON1 && e.isShiftDown()) { mode = DragMode.TRANSLATE_VIEW; }
9090
} else {
9191
if (button == MouseEvent.BUTTON1) { mode = DragMode.ROTATE_VIEW; }
92-
else if (button == MouseEvent.BUTTON3) { mode = DragMode.ROTATE_VIEW; }
92+
else if (button == MouseEvent.BUTTON3) { mode = DragMode.TRANSLATE_VIEW; }
9393
}
9494
double xd = (double)(p.x - startPoint.x);
9595
double yd = (double)(p.y - startPoint.y);

0 commit comments

Comments
 (0)