Пример #1
0
 private void OnPointerDrag(PointerDragSignal ev)
 {
     currentSvgRect.setAttributeNS(null, "x", $"{ev.AnchoredStageX}px");
     currentSvgRect.setAttributeNS(null, "y", $"{ev.AnchoredStageY}px");
     currentSvgRect.setAttributeNS(null, "width", $"{ev.Width}px");
     currentSvgRect.setAttributeNS(null, "height", $"{ev.Height}px");
 }
Пример #2
0
 private void OnPointerDown(PointerDownSignal ev)
 {
     currentSvgRect = currentSvgRect = document.createElementNS(ToolUtils.SvgNamespace, "rect") as SVGRectElement;
     currentSvgRect.setAttributeNS(null, "x", $"{ev.StageX}px");
     currentSvgRect.setAttributeNS(null, "y", $"{ev.StageY}px");
     currentSvgRect.setAttributeNS(null, "width", "0");
     currentSvgRect.setAttributeNS(null, "height", "0");
     currentSvgRect.setAttributeNS(null, "stroke", "black");
     currentSvgRect.setAttributeNS(null, "fill", "transparent");
     currentSvgRect.style.pointerEvents = "none";
     Stage.Current.Canvas.CurrentLayer.Element.Append(new jQuery(currentSvgRect));
 }