diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/FinSetShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/FinSetShapes.java index 7a0f2e335..6602e462b 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/FinSetShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/FinSetShapes.java @@ -34,9 +34,9 @@ public class FinSetShapes extends RocketComponentShape { Coordinate c = finSetFront.add(finPoints[i]); if (i==0) - p.moveTo(c.x*S, c.y*S); + p.moveTo(c.x, c.y); else - p.lineTo(c.x*S, c.y*S); + p.lineTo(c.x, c.y); } p.closePath(); @@ -87,13 +87,13 @@ public class FinSetShapes extends RocketComponentShape { Path2D.Double p = new Path2D.Double(); a = finFront.add( c[0] ); - p.moveTo(a.z*S, a.y*S); + p.moveTo(a.z, a.y); a = finFront.add( c[1] ); - p.lineTo(a.z*S, a.y*S); + p.lineTo(a.z, a.y); a = finFront.add( c[2] ); - p.lineTo(a.z*S, a.y*S); + p.lineTo(a.z, a.y); a = finFront.add( c[3] ); - p.lineTo(a.z*S, a.y*S); + p.lineTo(a.z, a.y); p.closePath(); return new Shape[]{p}; @@ -190,9 +190,9 @@ public class FinSetShapes extends RocketComponentShape { for (int i=0; i < array.length; i++) { Coordinate a = t.transform(compCenter.add( array[i]) ); if (i==0) - p.moveTo(a.z*S, a.y*S); + p.moveTo(a.z, a.y); else - p.lineTo(a.z*S, a.y*S); + p.lineTo(a.z, a.y); } p.closePath(); return p; diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/MassComponentShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/MassComponentShapes.java index 788872801..2742d959d 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/MassComponentShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/MassComponentShapes.java @@ -30,8 +30,7 @@ public class MassComponentShapes extends RocketComponentShape { Coordinate start = transformation.transform( componentAbsoluteLocation); Shape[] s = new Shape[1]; - s[0] = new RoundRectangle2D.Double(start.x*S,(start.y-radius)*S, - length*S,2*radius*S,arc*S,arc*S); + s[0] = new RoundRectangle2D.Double(start.x, (start.y-radius), length, 2*radius, arc, arc); switch (type) { case ALTIMETER: @@ -75,7 +74,7 @@ public class MassComponentShapes extends RocketComponentShape { Shape[] s = new Shape[start.length]; for (int i=0; i < start.length; i++) { - s[i] = new Ellipse2D.Double((start[i].z-or)*S,(start[i].y-or)*S,2*or*S,2*or*S); + s[i] = new Ellipse2D.Double((start[i].z-or),(start[i].y-or),2*or,2*or); } return RocketComponentShape.toArray(s, component); } diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/MassObjectShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/MassObjectShapes.java index 38a87437c..c66f66699 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/MassObjectShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/MassObjectShapes.java @@ -23,8 +23,8 @@ public class MassObjectShapes extends RocketComponentShape { Shape[] s = new Shape[start.length]; for (int i=0; i < start.length; i++) { - s[i] = new RoundRectangle2D.Double(start[i].x*S,(start[i].y-radius)*S, - length*S,2*radius*S,arc*S,arc*S); + s[i] = new RoundRectangle2D.Double(start[i].x,(start[i].y-radius), + length,2*radius,arc,arc); } return RocketComponentShape.toArray(s, component); @@ -44,7 +44,7 @@ public class MassObjectShapes extends RocketComponentShape { Shape[] s = new Shape[start.length]; for (int i=0; i < start.length; i++) { - s[i] = new Ellipse2D.Double((start[i].z-or)*S,(start[i].y-or)*S,2*or*S,2*or*S); + s[i] = new Ellipse2D.Double((start[i].z-or),(start[i].y-or),2*or,2*or); } return RocketComponentShape.toArray(s, component); } diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/ParachuteShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/ParachuteShapes.java index 49f88ee71..bbfbeb503 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/ParachuteShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/ParachuteShapes.java @@ -26,8 +26,7 @@ public class ParachuteShapes extends RocketComponentShape { Shape[] s = new Shape[start.length]; for (int i=0; i < start.length; i++) { - s[i] = new RoundRectangle2D.Double(start[i].x*S,(start[i].y-radius)*S, - length*S,2*radius*S,arc*S,arc*S); + s[i] = new RoundRectangle2D.Double(start[i].x, (start[i].y-radius), length, 2*radius, arc, arc); } return RocketComponentShape.toArray( addSymbol(s), component); } @@ -46,7 +45,7 @@ public class ParachuteShapes extends RocketComponentShape { Shape[] s = new Shape[start.length]; for (int i=0; i < start.length; i++) { - s[i] = new Ellipse2D.Double((start[i].z-or)*S,(start[i].y-or)*S,2*or*S,2*or*S); + s[i] = new Ellipse2D.Double((start[i].z-or),(start[i].y-or),2*or,2*or); } return RocketComponentShape.toArray( s, component); } diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/RailButtonShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/RailButtonShapes.java index 0222656e5..4abcc49bc 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/RailButtonShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/RailButtonShapes.java @@ -43,12 +43,12 @@ public class RailButtonShapes extends RocketComponentShape { final double drawHeight = outerDiameter*sinr; final Point2D.Double center = new Point2D.Double( instanceAbsoluteLocation.x, instanceAbsoluteLocation.y ); Point2D.Double lowerLeft = new Point2D.Double( center.x - outerRadius, center.y-outerRadius*sinr); - path.append( new Ellipse2D.Double( lowerLeft.x*S, lowerLeft.y*S, drawWidth*S, drawHeight*S), false); + path.append( new Ellipse2D.Double( lowerLeft.x, lowerLeft.y, drawWidth, drawHeight), false); - path.append( new Line2D.Double( lowerLeft.x*S, center.y*S, lowerLeft.x*S, (center.y+baseHeightcos)*S ), false); - path.append( new Line2D.Double( (center.x+outerRadius)*S, center.y*S, (center.x+outerRadius)*S, (center.y+baseHeightcos)*S ), false); + path.append( new Line2D.Double( lowerLeft.x, center.y, lowerLeft.x, (center.y+baseHeightcos) ), false); + path.append( new Line2D.Double( (center.x+outerRadius), center.y, (center.x+outerRadius), (center.y+baseHeightcos) ), false); - path.append( new Ellipse2D.Double( lowerLeft.x*S, (lowerLeft.y+baseHeightcos)*S, drawWidth*S, drawHeight*S), false); + path.append( new Ellipse2D.Double( lowerLeft.x, (lowerLeft.y+baseHeightcos), drawWidth, drawHeight), false); } {// inner @@ -56,24 +56,24 @@ public class RailButtonShapes extends RocketComponentShape { final double drawHeight = innerDiameter*sinr; final Point2D.Double center = new Point2D.Double( instanceAbsoluteLocation.x, instanceAbsoluteLocation.y + baseHeightcos); final Point2D.Double lowerLeft = new Point2D.Double( center.x - innerRadius, center.y-innerRadius*sinr); - path.append( new Ellipse2D.Double( lowerLeft.x*S, lowerLeft.y*S, drawWidth*S, drawHeight*S), false); + path.append( new Ellipse2D.Double( lowerLeft.x, lowerLeft.y, drawWidth, drawHeight), false); - path.append( new Line2D.Double( lowerLeft.x*S, center.y*S, lowerLeft.x*S, (center.y+innerHeightcos)*S ), false); - path.append( new Line2D.Double( (center.x+innerRadius)*S, center.y*S, (center.x+innerRadius)*S, (center.y+innerHeightcos)*S ), false); + path.append( new Line2D.Double( lowerLeft.x, center.y, lowerLeft.x, (center.y+innerHeightcos) ), false); + path.append( new Line2D.Double( (center.x+innerRadius), center.y, (center.x+innerRadius), (center.y+innerHeightcos) ), false); - path.append( new Ellipse2D.Double( lowerLeft.x*S, (lowerLeft.y+innerHeightcos)*S, drawWidth*S, drawHeight*S), false); + path.append( new Ellipse2D.Double( lowerLeft.x, (lowerLeft.y+innerHeightcos), drawWidth, drawHeight), false); } {// outer flange final double drawWidth = outerDiameter; final double drawHeight = outerDiameter*sinr; final Point2D.Double center = new Point2D.Double( instanceAbsoluteLocation.x, instanceAbsoluteLocation.y+baseHeightcos+innerHeightcos); final Point2D.Double lowerLeft = new Point2D.Double( center.x - outerRadius, center.y-outerRadius*sinr); - path.append( new Ellipse2D.Double( lowerLeft.x*S, lowerLeft.y*S, drawWidth*S, drawHeight*S), false); + path.append( new Ellipse2D.Double( lowerLeft.x, lowerLeft.y, drawWidth, drawHeight), false); - path.append( new Line2D.Double( lowerLeft.x*S, center.y*S, lowerLeft.x*S, (center.y+flangeHeightcos)*S ), false); - path.append( new Line2D.Double( (center.x+outerRadius)*S, center.y*S, (center.x+outerRadius)*S, (center.y+flangeHeightcos)*S ), false); + path.append( new Line2D.Double( lowerLeft.x, center.y, lowerLeft.x, (center.y+flangeHeightcos) ), false); + path.append( new Line2D.Double( (center.x+outerRadius), center.y, (center.x+outerRadius), (center.y+flangeHeightcos) ), false); - path.append( new Ellipse2D.Double( lowerLeft.x*S, (lowerLeft.y+flangeHeightcos)*S, drawWidth*S, drawHeight*S), false); + path.append( new Ellipse2D.Double( lowerLeft.x, (lowerLeft.y+flangeHeightcos), drawWidth, drawHeight), false); } return RocketComponentShape.toArray( new Shape[]{ path }, component ); @@ -131,10 +131,10 @@ public class RailButtonShapes extends RocketComponentShape { final double sinr = Math.sin(angle_rad); final double cosr = Math.cos(angle_rad); - rect.moveTo( (x-radius*cosr)*S, (y+radius*sinr)*S); - rect.lineTo( (x-radius*cosr+height*sinr)*S, (y+radius*sinr+height*cosr)*S); - rect.lineTo( (x+radius*cosr+height*sinr)*S, (y-radius*sinr+height*cosr)*S); - rect.lineTo( (x+radius*cosr)*S, (y-radius*sinr)*S); + rect.moveTo( (x-radius*cosr), (y+radius*sinr)); + rect.lineTo( (x-radius*cosr+height*sinr), (y+radius*sinr+height*cosr)); + rect.lineTo( (x+radius*cosr+height*sinr), (y-radius*sinr+height*cosr)); + rect.lineTo( (x+radius*cosr), (y-radius*sinr)); rect.closePath(); // add points diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/RocketComponentShape.java b/swing/src/net/sf/openrocket/gui/rocketfigure/RocketComponentShape.java index d3c2fbd52..be1ccc916 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/RocketComponentShape.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/RocketComponentShape.java @@ -16,8 +16,6 @@ import net.sf.openrocket.util.Transformation; */ public class RocketComponentShape { - protected static final double S = RocketFigure.EXTRA_SCALE; - final public boolean hasShape; final public Shape shape; final public net.sf.openrocket.util.Color color; diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/ShockCordShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/ShockCordShapes.java index 58396a4b1..7387399b5 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/ShockCordShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/ShockCordShapes.java @@ -25,8 +25,8 @@ public class ShockCordShapes extends RocketComponentShape { Coordinate start = transformation.transform( componentAbsoluteLocation); Shape[] s = new Shape[1]; - s[0] = new RoundRectangle2D.Double(start.x*S,(start.y-radius)*S, - length*S,2*radius*S,arc*S,arc*S); + s[0] = new RoundRectangle2D.Double(start.x,(start.y-radius), + length,2*radius,arc,arc); return RocketComponentShape.toArray( addSymbol(s), component); } @@ -43,13 +43,13 @@ public class ShockCordShapes extends RocketComponentShape { Shape[] s = new Shape[1]; Coordinate start = componentAbsoluteLocation; - s[0] = new Ellipse2D.Double((start.z-or)*S,(start.y-or)*S,2*or*S,2*or*S); + s[0] = new Ellipse2D.Double((start.z-or),(start.y-or),2*or,2*or); // Coordinate[] start = transformation.transform(tube.toAbsolute(instanceOffset)); // // Shape[] s = new Shape[start.length]; // for (int i=0; i < start.length; i++) { -// s[i] = new Ellipse2D.Double((start[i].z-or)*S,(start[i].y-or)*S,2*or*S,2*or*S); +// s[i] = new Ellipse2D.Double((start[i].z-or),(start[i].y-or),2*or,2*or); // } return RocketComponentShape.toArray( s, component); } diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/StreamerShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/StreamerShapes.java index 28bec20cc..480e8d958 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/StreamerShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/StreamerShapes.java @@ -24,14 +24,14 @@ public class StreamerShapes extends RocketComponentShape { Shape[] s = new Shape[1]; Coordinate frontCenter = componentAbsoluteLocation; - s[0] = new RoundRectangle2D.Double((frontCenter.x)*S,(frontCenter.y-radius)*S, - length*S,2*radius*S,arc*S,arc*S); + s[0] = new RoundRectangle2D.Double((frontCenter.x),(frontCenter.y-radius), + length,2*radius,arc,arc); // Coordinate[] start = transformation.transform(tube.toAbsolute(instanceOffset)); // Shape[] s = new Shape[start.length]; // for (int i=0; i < start.length; i++) { -// s[i] = new RoundRectangle2D.Double(start[i].x*S,(start[i].y-radius)*S, -// length*S,2*radius*S,arc*S,arc*S); +// s[i] = new RoundRectangle2D.Double(start[i].x,(start[i].y-radius), +// length,2*radius,arc,arc); // } return RocketComponentShape.toArray(addSymbol(s), component); } @@ -47,13 +47,13 @@ public class StreamerShapes extends RocketComponentShape { double or = tube.getRadius(); Shape[] s = new Shape[1]; Coordinate center = componentAbsoluteLocation; - s[0] = new Ellipse2D.Double((center.z-or)*S,(center.y-or)*S,2*or*S,2*or*S); + s[0] = new Ellipse2D.Double((center.z-or),(center.y-or),2*or,2*or); // Coordinate[] start = transformation.transform(tube.toAbsolute(instanceOffset)); // // Shape[] s = new Shape[start.length]; // for (int i=0; i < start.length; i++) { -// s[i] = new Ellipse2D.Double((start[i].z-or)*S,(start[i].y-or)*S,2*or*S,2*or*S); +// s[i] = new Ellipse2D.Double((start[i].z-or),(start[i].y-or),2*or,2*or); // } return RocketComponentShape.toArray(s, component); } diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/SymmetricComponentShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/SymmetricComponentShapes.java index c08fd49ac..e03a94b4d 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/SymmetricComponentShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/SymmetricComponentShapes.java @@ -1,5 +1,6 @@ package net.sf.openrocket.gui.rocketfigure; +import net.sf.openrocket.rocketcomponent.SymmetricComponent; import net.sf.openrocket.util.Coordinate; import net.sf.openrocket.util.MathUtil; import net.sf.openrocket.util.Transformation; @@ -21,15 +22,8 @@ public class SymmetricComponentShapes extends RocketComponentShape { Transformation transformation, Coordinate componentAbsoluteLocation) { - return getShapesSide(component, transformation, componentAbsoluteLocation, S); - } - - public static RocketComponentShape[] getShapesSide( - net.sf.openrocket.rocketcomponent.RocketComponent component, - Transformation transformation, - Coordinate componentAbsoluteLocation, - final double scaleFactor) { - net.sf.openrocket.rocketcomponent.SymmetricComponent c = (net.sf.openrocket.rocketcomponent.SymmetricComponent) component; + SymmetricComponent c = (SymmetricComponent) component; + int i; final double delta = 0.0000001; @@ -89,14 +83,14 @@ public class SymmetricComponentShapes extends RocketComponentShape { // TODO: LOW: curved path instead of linear Path2D.Double path = new Path2D.Double(); - path.moveTo((nose.x + points.get(len - 1).x) * scaleFactor, (nose.y+points.get(len - 1).y) * scaleFactor); + path.moveTo((nose.x + points.get(len - 1).x) , (nose.y+points.get(len - 1).y) ); for (i = len - 2; i >= 0; i--) { - path.lineTo((nose.x+points.get(i).x)* scaleFactor, (nose.y+points.get(i).y) * scaleFactor); + path.lineTo((nose.x+points.get(i).x), (nose.y+points.get(i).y) ); } for (i = 0; i < len; i++) { - path.lineTo((nose.x+points.get(i).x) * scaleFactor, (nose.y-points.get(i).y) * scaleFactor); + path.lineTo((nose.x+points.get(i).x) , (nose.y-points.get(i).y) ); } - path.lineTo((nose.x+points.get(len - 1).x) * scaleFactor, (nose.y+points.get(len - 1).y) * scaleFactor); + path.lineTo((nose.x+points.get(len - 1).x) , (nose.y+points.get(len - 1).y) ); path.closePath(); //s[len] = path; diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/TransitionShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/TransitionShapes.java index 5a937ac79..e47db5fa2 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/TransitionShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/TransitionShapes.java @@ -8,7 +8,6 @@ import net.sf.openrocket.util.Transformation; import java.awt.*; import java.awt.geom.Ellipse2D; import java.awt.geom.Path2D; -import java.awt.geom.Rectangle2D; public class TransitionShapes extends RocketComponentShape { @@ -16,10 +15,10 @@ public class TransitionShapes extends RocketComponentShape { // TODO: LOW: Uses only first component of cluster (not currently clusterable). public static RocketComponentShape[] getShapesSide( - net.sf.openrocket.rocketcomponent.RocketComponent component, - Transformation transformation, - Coordinate instanceLocation) { - return getShapesSide(component, transformation, instanceLocation, S); + RocketComponent component, + Transformation transformation, + Coordinate instanceLocation) { + return getShapesSide(component, transformation, instanceLocation, 1.0); } public static RocketComponentShape[] getShapesSide( @@ -27,7 +26,8 @@ public class TransitionShapes extends RocketComponentShape { Transformation transformation, Coordinate instanceAbsoluteLocation, final double scaleFactor) { - + + Transition transition = (Transition)component; RocketComponentShape[] mainShapes; @@ -41,15 +41,15 @@ public class TransitionShapes extends RocketComponentShape { double r2 = transition.getAftRadius(); Path2D.Float path = new Path2D.Float(); - path.moveTo( (frontCenter.x)* scaleFactor, (frontCenter.y+ r1)* scaleFactor); - path.lineTo( (frontCenter.x+length)* scaleFactor, (frontCenter.y+r2)* scaleFactor); - path.lineTo( (frontCenter.x+length)* scaleFactor, (frontCenter.y-r2)* scaleFactor); - path.lineTo( (frontCenter.x)* scaleFactor, (frontCenter.y-r1)* scaleFactor); + path.moveTo( (frontCenter.x), (frontCenter.y+ r1)); + path.lineTo( (frontCenter.x+length), (frontCenter.y+r2)); + path.lineTo( (frontCenter.x+length), (frontCenter.y-r2)); + path.lineTo( (frontCenter.x), (frontCenter.y-r1)); path.closePath(); mainShapes = new RocketComponentShape[] { new RocketComponentShape( path, component) }; } else { - mainShapes = SymmetricComponentShapes.getShapesSide(component, transformation, instanceAbsoluteLocation, scaleFactor); + mainShapes = SymmetricComponentShapes.getShapesSide(component, transformation, instanceAbsoluteLocation); } Shape foreShoulder=null, aftShoulder=null; @@ -105,8 +105,8 @@ public class TransitionShapes extends RocketComponentShape { Coordinate center = componentAbsoluteLocation; Shape[] s = new Shape[2]; - s[0] = new Ellipse2D.Double((center.z-r1)*S,(center.y-r1)*S,2*r1*S,2*r1*S); - s[1] = new Ellipse2D.Double((center.z-r2)*S,(center.y-r2)*S,2*r2*S,2*r2*S); + s[0] = new Ellipse2D.Double((center.z-r1),(center.y-r1),2*r1,2*r1); + s[1] = new Ellipse2D.Double((center.z-r2),(center.y-r2),2*r2,2*r2); return RocketComponentShape.toArray(s, component); } diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/TubeFinSetShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/TubeFinSetShapes.java index 44a34bc05..5d6b56323 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/TubeFinSetShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/TubeFinSetShapes.java @@ -40,7 +40,7 @@ public class TubeFinSetShapes extends RocketComponentShape { Shape[] s = new Shape[fins]; for (int i=0; i - * The scaling factor used is divided by this value, and every coordinate used - * in the figures must be multiplied by this factor. - */ - public static final double EXTRA_SCALE = 1.0; public static final double INCHES_PER_METER = 39.3701; public static final double METERS_PER_INCH = 0.0254; diff --git a/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java b/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java index 8018d9c14..d725503e9 100644 --- a/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java +++ b/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java @@ -229,16 +229,16 @@ public class RocketFigure extends AbstractScaleFigure { float[] dashes = style.getDashes(); for (int j = 0; j < dashes.length; j++) { - dashes[j] *= EXTRA_SCALE / scale; + dashes[j] *= 1.0 / scale; } if (selected) { - g2.setStroke(new BasicStroke((float) (SELECTED_WIDTH * EXTRA_SCALE / scale), + g2.setStroke(new BasicStroke((float) (SELECTED_WIDTH / scale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, dashes, 0)); g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); } else { - g2.setStroke(new BasicStroke((float) (NORMAL_WIDTH * EXTRA_SCALE / scale), + g2.setStroke(new BasicStroke((float) (NORMAL_WIDTH / scale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, dashes, 0)); g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); @@ -246,7 +246,7 @@ public class RocketFigure extends AbstractScaleFigure { g2.draw(rcs.shape); } - g2.setStroke(new BasicStroke((float) (NORMAL_WIDTH * EXTRA_SCALE / scale), + g2.setStroke(new BasicStroke((float) (NORMAL_WIDTH / scale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)); g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); @@ -276,13 +276,15 @@ public class RocketFigure extends AbstractScaleFigure { { Shape s; if (currentViewType == RocketPanel.VIEW_TYPE.SideView) { - s = new Rectangle2D.Double(EXTRA_SCALE * curMotorLocation.x, - EXTRA_SCALE * (curMotorLocation.y - motorRadius), EXTRA_SCALE * motorLength, - EXTRA_SCALE * 2 * motorRadius); + s = new Rectangle2D.Double( curMotorLocation.x, + (curMotorLocation.y - motorRadius), + motorLength, + 2 * motorRadius); } else { - s = new Ellipse2D.Double(EXTRA_SCALE * (curMotorLocation.z - motorRadius), - EXTRA_SCALE * (curMotorLocation.y - motorRadius), EXTRA_SCALE * 2 * motorRadius, - EXTRA_SCALE * 2 * motorRadius); + s = new Ellipse2D.Double((curMotorLocation.z - motorRadius), + (curMotorLocation.y - motorRadius), + 2 * motorRadius, + 2 * motorRadius); } g2.setColor(fillColor); g2.fill(s); @@ -295,7 +297,7 @@ public class RocketFigure extends AbstractScaleFigure { // Draw relative extras for (FigureElement e : relativeExtra) { - e.paint(g2, scale / EXTRA_SCALE); + e.paint(g2, scale); } // Draw absolute extras diff --git a/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java b/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java index 6e1b0e3a2..8f0bd6208 100644 --- a/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java +++ b/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java @@ -641,8 +641,8 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change if (figure.getType() == RocketPanel.VIEW_TYPE.SideView && length > 0) { // TODO: LOW: Y-coordinate and rotation - extraCP.setPosition(cpx * RocketFigure.EXTRA_SCALE, 0); - extraCG.setPosition(cgx * RocketFigure.EXTRA_SCALE, 0); + extraCP.setPosition(cpx, 0); + extraCG.setPosition(cgx, 0); } else {