Skip to content

Commit 992f815

Browse files
committed
Image bounds needs to be a copy of the bounds after setLineWidth for these figures
- Before this change an image would be drawn outside the effective bounds of the figure
1 parent ee65086 commit 992f815

16 files changed

+48
-32
lines changed

com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/elements/AssessmentFigure.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ protected void drawFigure(Graphics graphics) {
4242
// Reduce width and height by 1 pixel
4343
rect.resize(-1, -1);
4444

45-
Rectangle imageBounds = rect.getCopy();
46-
4745
// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill
4846
setLineWidth(graphics, rect);
4947

48+
// Get this *after* setLineWidth
49+
Rectangle imageBounds = rect.getCopy();
50+
5051
setFigurePositionFromTextPosition(rect);
5152

5253
if(!isEnabled()) {

com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/elements/BusinessActorFigure.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ protected void drawFigure(Graphics graphics) {
4848
// Reduce width and height by 1 pixel
4949
rect.resize(-1, -1);
5050

51-
Rectangle imageBounds = rect.getCopy();
52-
5351
// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill
5452
setLineWidth(graphics, rect);
5553

54+
// Get this *after* setLineWidth
55+
Rectangle imageBounds = rect.getCopy();
56+
5657
setFigurePositionFromTextPosition(rect, 2/3.0);
5758

5859
if(!isEnabled()) {

com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/elements/CapabilityFigure.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ protected void drawFigure(Graphics graphics) {
4848
// Reduce width and height by 1 pixel
4949
rect.resize(-1, -1);
5050

51-
Rectangle imageBounds = rect.getCopy();
52-
5351
// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill
5452
setLineWidth(graphics, rect);
5553

54+
// Get this *after* setLineWidth
55+
Rectangle imageBounds = rect.getCopy();
56+
5657
setFigurePositionFromTextPosition(rect);
5758

5859
if(!isEnabled()) {

com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/elements/CollaborationFigure.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ protected void drawFigure(Graphics graphics) {
4747
// Reduce width and height by 1 pixel
4848
rect.resize(-1, -1);
4949

50-
Rectangle imageBounds = rect.getCopy();
51-
5250
// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill
5351
setLineWidth(graphics, rect);
5452

53+
// Get this *after* setLineWidth
54+
Rectangle imageBounds = rect.getCopy();
55+
5556
setFigurePositionFromTextPosition(rect, 1.5); // Should match 'diameter'
5657

5758
if(!isEnabled()) {

com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/elements/CourseOfActionFigure.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ protected void drawFigure(Graphics graphics) {
4949
// Reduce width and height by 1 pixel
5050
rect.resize(-1, -1);
5151

52-
Rectangle imageBounds = rect.getCopy();
53-
5452
// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill
5553
setLineWidth(graphics, rect);
5654

55+
// Get this *after* setLineWidth
56+
Rectangle imageBounds = rect.getCopy();
57+
5758
setFigurePositionFromTextPosition(rect, 1.24); // Should match '3.1 / 2.5' (values used in getRadius() and getCenter())
5859

5960
if(!isEnabled()) {

com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/elements/EquipmentFigure.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ protected void drawFigure(Graphics graphics) {
5252
// Reduce width and height by 1 pixel
5353
rect.resize(-1, -1);
5454

55-
Rectangle imageBounds = rect.getCopy();
56-
5755
// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill
5856
setLineWidth(graphics, rect);
5957

58+
// Get this *after* setLineWidth
59+
Rectangle imageBounds = rect.getCopy();
60+
6061
setFigurePositionFromTextPosition(rect);
6162

6263
if(!isEnabled()) {

com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/elements/FacilityFigure.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ protected void drawFigure(Graphics graphics) {
4949
// Reduce width and height by 1 pixel
5050
rect.resize(-1, -1);
5151

52-
Rectangle imageBounds = rect.getCopy();
53-
5452
// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill
5553
setLineWidth(graphics, rect);
5654

55+
// Get this *after* setLineWidth
56+
Rectangle imageBounds = rect.getCopy();
57+
5758
setFigurePositionFromTextPosition(rect);
5859

5960
if(!isEnabled()) {

com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/elements/GapFigure.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ protected void drawFigure(Graphics graphics) {
4848
// Reduce width and height by 1 pixel
4949
rect.resize(-1, -1);
5050

51-
Rectangle imageBounds = rect.getCopy();
52-
5351
// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill
5452
setLineWidth(graphics, rect);
5553

54+
// Get this *after* setLineWidth
55+
Rectangle imageBounds = rect.getCopy();
56+
5657
setFigurePositionFromTextPosition(rect, 5/3.0); // Should match 'widthFraction' formula
5758

5859
if(!isEnabled()) {

com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/elements/GoalFigure.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ protected void drawFigure(Graphics graphics) {
4141
// Reduce width and height by 1 pixel
4242
rect.resize(-1, -1);
4343

44-
Rectangle imageBounds = rect.getCopy();
45-
4644
// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill
4745
setLineWidth(graphics, rect);
4846

47+
// Get this *after* setLineWidth
48+
Rectangle imageBounds = rect.getCopy();
49+
4950
setFigurePositionFromTextPosition(rect);
5051

5152
if(!isEnabled()) {

com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/elements/InteractionFigure.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ protected void drawFigure(Graphics graphics) {
5252
// Reduce width and height by 1 pixel
5353
rect.resize(-1, -1);
5454

55-
Rectangle imageBounds = rect.getCopy();
56-
5755
// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill
5856
setLineWidth(graphics, rect);
5957

58+
// Get this *after* setLineWidth
59+
Rectangle imageBounds = rect.getCopy();
60+
6061
setFigurePositionFromTextPosition(rect, 1 / 0.86); // Should match 'FRACTION' defined in getFigurePath()
6162

6263
if(!isEnabled()) {

0 commit comments

Comments
 (0)