Code Duplication    Length = 9-9 lines in 2 locations

src/main/java/org/gannacademy/cdf/graphics/geom/CubicCurve.java 2 locations

@@ 127-135 (lines=9) @@
124
    );
125
  }
126
127
  @Override
128
  public void setHeight(double height) {
129
    // FIXME this feels hacktackular
130
    double scale = height / getHeight();
131
    setCurve(
132
            getX1(), getY() + (getY1() - getY()) * scale,
133
            getCtrlX1(), getY() + (getCtrlY1() - getY()) * scale,
134
            getCtrlX2(), getY() + (getCtrlY2() - getY()) * scale,
135
            getX2(), getY() + (getY2() - getY()) * scale
136
    );
137
  }
138
@@ 115-123 (lines=9) @@
112
    }
113
  }
114
115
  @Override
116
  public void setWidth(double width) {
117
    // FIXME this feels hacktacular
118
    double scale = width / getWidth();
119
    setCurve(
120
            getX() + (getX1() - getX()) * scale, getY1(),
121
            getX() + (getCtrlX1() - getX()) * scale, getCtrlY1(),
122
            getX() + (getCtrlX2() - getX()) * scale, getCtrlY2(),
123
            getX() + (getX2() - getX()) * scale, getY2()
124
    );
125
  }
126