RelEllipticalArcTo.java 755 B

12345678910111213141516171819202122232425262728
  1. package com.mxgraph.io.vsdx.geometry;
  2. import com.mxgraph.io.vsdx.Shape;
  3. import com.mxgraph.io.vsdx.mxVsdxUtils;
  4. import com.mxgraph.util.mxPoint;
  5. public class RelEllipticalArcTo extends EllipticalArcTo
  6. {
  7. public RelEllipticalArcTo(int index, Double x, Double y, Double a, Double b, Double c, Double d)
  8. {
  9. super(index, x, y, a, b, c, d);
  10. }
  11. @Override
  12. public String handle(mxPoint p, Shape shape) {
  13. if (this.x != null && this.y != null && this.a != null && this.b != null && this.c != null && this.d != null)
  14. {
  15. double h = shape.getHeight() / mxVsdxUtils.conversionFactor;
  16. double w = shape.getWidth() / mxVsdxUtils.conversionFactor;
  17. this.x *= w;
  18. this.y *= h;
  19. this.a *= w;
  20. this.b *= h;
  21. }
  22. return super.handle(p, shape);
  23. }
  24. }