Skip to content

Commit

Permalink
Fixed issue #994.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsschmidt1337 committed Oct 7, 2023
1 parent 8523d96 commit 7f25f80
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/org/nschmidt/ldparteditor/dialog/rotate/RotateDesign.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class RotateDesign extends Dialog {
Vertex p = new Vertex(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO);
Vertex m = new Vertex(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO);
Vertex c = new Vertex(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO);
private final boolean isLoadingClipboardVertex;
private final boolean isLoadingManipulatorPosition;

RotateDesign(Shell parentShell, Vertex v, Set<Vertex> clipboardVertices, Vertex manipulatorPosition, ManipulatorScope scope) {
super(parentShell);
Expand All @@ -94,8 +96,15 @@ class RotateDesign extends Dialog {
if (clipboardVertices.size() == 1) {
p = clipboardVertices.iterator().next();
c = new Vertex(p.xp, p.yp, p.zp);
isLoadingClipboardVertex = true;
isLoadingManipulatorPosition = false;
} else if (transformationMode == ManipulatorScope.LOCAL && manipulatorPosition != null) {
p = new Vertex(m.xp, m.yp, m.zp);
isLoadingClipboardVertex = false;
isLoadingManipulatorPosition = true;
} else {
isLoadingClipboardVertex = false;
isLoadingManipulatorPosition = false;
}
}

Expand Down Expand Up @@ -210,6 +219,19 @@ protected Control createDialogArea(Composite parent) {
btnPivotClipboard.setImage(ResourceManager.getImage("icon8_edit-paste.png")); //$NON-NLS-1$
btnPivotClipboard.setText(I18n.ROTATE_PIVOT_CLIPBOARD);
}

if (!isLoadingClipboardVertex) {
Label lblClipboardVertex = new Label(cmpContainer, SWT.NONE);
lblClipboardVertex.setText(I18n.ROTATE_PIVOT_INITIAL_A);
} else {
Label lblClipboardVertex = new Label(cmpContainer, SWT.NONE);
lblClipboardVertex.setText(I18n.ROTATE_PIVOT_INITIAL_B);
}

if (isLoadingManipulatorPosition) {
Label lblManipulatorPosition = new Label(cmpContainer, SWT.NONE);
lblManipulatorPosition.setText(I18n.ROTATE_PIVOT_INITIAL_C);
}

{
Composite cmpTxt = new Composite(cmpContainer, SWT.NONE);
Expand Down
22 changes: 22 additions & 0 deletions src/org/nschmidt/ldparteditor/dialog/scale/ScaleDesign.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class ScaleDesign extends Dialog {
Vertex p = new Vertex(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO);
Vertex m = new Vertex(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO);
Vertex c = new Vertex(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO);
private final boolean isLoadingClipboardVertex;
private final boolean isLoadingManipulatorPosition;

ScaleDesign(Shell parentShell, Vertex v, Set<Vertex> clipboardVertices, Vertex manipulatorPosition, ManipulatorScope scope) {
super(parentShell);
Expand All @@ -91,8 +93,15 @@ class ScaleDesign extends Dialog {
if (clipboardVertices.size() == 1) {
p = clipboardVertices.iterator().next();
c = new Vertex(p.xp, p.yp, p.zp);
isLoadingClipboardVertex = true;
isLoadingManipulatorPosition = false;
} else if (transformationMode == ManipulatorScope.LOCAL && manipulatorPosition != null) {
p = new Vertex(m.xp, m.yp, m.zp);
isLoadingClipboardVertex = false;
isLoadingManipulatorPosition = true;
} else {
isLoadingClipboardVertex = false;
isLoadingManipulatorPosition = false;
}
}

Expand Down Expand Up @@ -221,6 +230,19 @@ protected Control createDialogArea(Composite parent) {
btnPivotClipboard.setImage(ResourceManager.getImage("icon8_edit-paste.png")); //$NON-NLS-1$
btnPivotClipboard.setText(I18n.SCALE_PIVOT_CLIPBOARD);
}

if (!isLoadingClipboardVertex) {
Label lblClipboardVertex = new Label(cmpContainer, SWT.NONE);
lblClipboardVertex.setText(I18n.SCALE_PIVOT_INITIAL_A);
} else {
Label lblClipboardVertex = new Label(cmpContainer, SWT.NONE);
lblClipboardVertex.setText(I18n.SCALE_PIVOT_INITIAL_B);
}

if (isLoadingManipulatorPosition) {
Label lblManipulatorPosition = new Label(cmpContainer, SWT.NONE);
lblManipulatorPosition.setText(I18n.SCALE_PIVOT_INITIAL_C);
}

{
Composite cmpTxt = new Composite(cmpContainer, SWT.NONE);
Expand Down
6 changes: 6 additions & 0 deletions src/org/nschmidt/ldparteditor/i18n/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,9 @@ private static void adjust() { // Calculate line offset
public static final String RECTIFIER_VERBOSE_MSG = RECTIFIER.getString(getProperty());
public static final String ROTATE_PIVOT = ROTATE.getString(getProperty());
public static final String ROTATE_PIVOT_CLIPBOARD = ROTATE.getString(getProperty());
public static final String ROTATE_PIVOT_INITIAL_A = ROTATE.getString(getProperty());
public static final String ROTATE_PIVOT_INITIAL_B = ROTATE.getString(getProperty());
public static final String ROTATE_PIVOT_INITIAL_C = ROTATE.getString(getProperty());
public static final String ROTATE_PIVOT_MANIPULATOR = ROTATE.getString(getProperty());
public static final String ROTATE_TITLE = ROTATE.getString(getProperty());
public static final String ROTATE_X = ROTATE.getString(getProperty());
Expand All @@ -1228,6 +1231,9 @@ private static void adjust() { // Calculate line offset
public static final String ROUND_Z = ROUND.getString(getProperty());
public static final String SCALE_PIVOT = SCALE.getString(getProperty());
public static final String SCALE_PIVOT_CLIPBOARD = SCALE.getString(getProperty());
public static final String SCALE_PIVOT_INITIAL_A = SCALE.getString(getProperty());
public static final String SCALE_PIVOT_INITIAL_B = SCALE.getString(getProperty());
public static final String SCALE_PIVOT_INITIAL_C = SCALE.getString(getProperty());
public static final String SCALE_PIVOT_MANIPULATOR = SCALE.getString(getProperty());
public static final String SCALE_TITLE = SCALE.getString(getProperty());
public static final String SCALE_X = SCALE.getString(getProperty());
Expand Down
3 changes: 3 additions & 0 deletions src/org/nschmidt/ldparteditor/i18n/Rotate.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
PIVOT = Pivot Point:
PIVOT_CLIPBOARD = Set Pivot Point to Clipboard Vertex Position
PIVOT_INITIAL_A = When you copy one single vertex to the clipboard, it will be inserted here.
PIVOT_INITIAL_B = A vertex from the clipboard was inserted here.
PIVOT_INITIAL_C = Now, the position of the manipulator was inserted.
PIVOT_MANIPULATOR = Set Pivot Point to Manipulator Position
TITLE = Rotate around X/Y/Z:
X = a(X) [\u00B0]
Expand Down
3 changes: 3 additions & 0 deletions src/org/nschmidt/ldparteditor/i18n/Scale.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
PIVOT = Pivot Point:
PIVOT_CLIPBOARD = Set Pivot Point to Clipboard Vertex Position
PIVOT_INITIAL_A = When you copy one single vertex to the clipboard, it will be inserted here.
PIVOT_INITIAL_B = A vertex from the clipboard was inserted here.
PIVOT_INITIAL_C = Now, the position of the manipulator was inserted.
PIVOT_MANIPULATOR = Set Pivot Point to Manipulator Position
TITLE = Scale around X/Y/Z:
X = \ X *
Expand Down

0 comments on commit 7f25f80

Please sign in to comment.