cp.setRelativeX(cp.getRelativeX()+lastDiffX+uiPanel.getScrollLeft()); cp.setRelativeY(cp.getRelativeY()+lastDiffY+uiPanel.getScrollTop());
float dx = Math.abs(cp.getRelativeX() - m.getRelativeX()); float dy = Math.abs(cp.getRelativeY() - m.getRelativeY());
@Override public void refresh() { super.refresh(); invisibleLinearPath.getPoints().clear(); // TODO: determine best path // - rebuild it with new points starting with start point IConnectorPoint previousConnectorPoint = this.connectorStart; com.ebmwebsourcing.geasytools.geasysvg.ext.impl.Point previousPoint = null; while (previousConnectorPoint != null) { com.ebmwebsourcing.geasytools.geasysvg.ext.impl.Point point = new com.ebmwebsourcing.geasytools.geasysvg.ext.impl.Point( previousConnectorPoint.getRelativeX()+getUIPanel().getScrollLeft(), previousConnectorPoint.getRelativeY()+getUIPanel().getScrollTop()); if (previousPoint != null) previousPoint.setNextPoint(point); invisibleLinearPath.addPoint(point); previousConnectorPoint = previousConnectorPoint.getNextPoint(); previousPoint = point; } invisibleLinearPath.connectAllPoints(); refreshLabelPosition(); invisibleLinearPath.getElement().setAttribute("stroke-width", "7"); invisibleLinearPath.getElement().setAttribute("pointer-events", "painted"); invisibleLinearPath.getElement().setAttribute("visibility", "hidden"); //invisibleLinearPath.toFront(); this.visibleLinearPath.getElement().setAttribute("d", this.invisibleLinearPath.getElement().getAttribute("d")); //visibleLinearPath.toBack(); this.group.toFront(); }
p.setRelativeX(p.getRelativeX()+dx); p.setRelativeY(p.getRelativeY()+dy);