Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Converted margin into the RenderingParameter variant

  • Loading branch information...
commit f0c54067e8e7edfac0e9b80e2828c132e4c7bf93 1 parent fed9ee3
@egonw egonw authored egonw committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/main/org/openscience/cdk/renderer/Renderer.java
View
7 src/main/org/openscience/cdk/renderer/Renderer.java
@@ -41,6 +41,7 @@
import org.openscience.cdk.renderer.font.IFontManager;
import org.openscience.cdk.renderer.generators.IGenerator;
import org.openscience.cdk.renderer.generators.IReactionGenerator;
+import org.openscience.cdk.renderer.generators.BasicSceneGenerator.Margin;
import org.openscience.cdk.renderer.visitor.IDrawVisitor;
/**
@@ -759,7 +760,8 @@ public void setZoomToFit(double drawWidth,
double diagramWidth,
double diagramHeight) {
- double m = this.rendererModel.getMargin();
+ double m = this.rendererModel
+ .getRenderingParameter(Margin.class).getValue();
// determine the zoom needed to fit the diagram to the screen
double widthRatio = drawWidth / (diagramWidth + (2 * m));
@@ -896,7 +898,8 @@ private Rectangle convertToDiagramBounds(Rectangle2D modelBounds) {
return new Rectangle((int)mc.x, (int)mc.y, 0, 0);
}
- double margin = this.rendererModel.getMargin();
+ double margin = this.rendererModel
+ .getRenderingParameter(Margin.class).getValue();
int w = (int) ((scale * zoom * mw) + (2 * margin));
int h = (int) ((scale * zoom * mh) + (2 * margin));
int x = (int) (mc.x - w / 2);
Please sign in to comment.
Something went wrong with that request. Please try again.