public ScaleAction(ComposerActionFactory factory, SVGObject selected, MouseEvent me) { super(factory); m_scaled = selected; m_x = me.getX(); m_y = me.getY(); pt = m_scaled.getOutline().getScalePivotPoint(m_x, m_y); m_scalePtIdx = getScalePivotPoint(m_scaled, m_x, m_y); }
private SVGObject.ScalePivotPoint getScalePivotPoint(SVGObject selObj, float x, float y) { SVGObjectOutline outline = selObj.getOutline(); if (outline.isAtScaleSEHandlePoint(x, y) || outline.isAtScaleEHandlePoint(x, y) || outline.isAtScaleSHandlePoint(x, y)) { return SVGObject.ScalePivotPoint.NW_CORNER; } else { return SVGObject.ScalePivotPoint.SE_CORNER; } }
private boolean isSEScalePoint(SVGObject selObj, MouseEvent me) { return selObj.getOutline().isAtScaleSEHandlePoint((float) me.getX(), (float) me.getY()); }