-
-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* See #650 * Adjust figure bounds according to the line width * AbstractDiagramModelObjectFigure#setLineWidth() only accepts integers * Use ExtendedSWTGraphics class so that we can determine the scale when exporting to image
- Loading branch information
Showing
9 changed files
with
82 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
com.archimatetool.editor/src/com/archimatetool/editor/diagram/util/ExtendedSWTGraphics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* This program and the accompanying materials | ||
* are made available under the terms of the License | ||
* which accompanies this distribution in the file LICENSE.txt | ||
*/ | ||
package com.archimatetool.editor.diagram.util; | ||
|
||
import org.eclipse.draw2d.SWTGraphics; | ||
import org.eclipse.swt.graphics.GC; | ||
|
||
/** | ||
* Extended SWTGraphics so we can query the scale | ||
* | ||
* @author Phillip Beauvoir | ||
*/ | ||
public class ExtendedSWTGraphics extends SWTGraphics { | ||
|
||
private double scale = 1.0; | ||
|
||
public ExtendedSWTGraphics(GC gc) { | ||
super(gc); | ||
} | ||
|
||
@Override | ||
public void scale(double factor) { | ||
super.scale(factor); | ||
scale = factor; | ||
} | ||
|
||
/** | ||
* Don't over-ride getAbsoluteScale() as we want that to remain the same | ||
* | ||
* @return The current scale | ||
*/ | ||
public double getScale() { | ||
return scale; | ||
} | ||
} |