diff --git a/src/extension/object/VerticalText.ts b/src/extension/object/VerticalText.ts index fb72d40d..7aeeff97 100644 --- a/src/extension/object/VerticalText.ts +++ b/src/extension/object/VerticalText.ts @@ -476,7 +476,12 @@ export class VerticalText extends IText { ctx.fillStyle = originalFill; this._removeShadow(ctx); } - + + toSVG(reviver?: TSVGReviver): string { + const imageData = this.toDataURL() + return `` + } + getLocalPointer(e: TPointerEvent, pointer?: Point) { pointer = pointer || this.canvas!.getPointer(e); let pClicked = new Point(pointer.x, pointer.y) diff --git a/src/hooks/useHandleTool.ts b/src/hooks/useHandleTool.ts index 129ecd63..c337a1e5 100644 --- a/src/hooks/useHandleTool.ts +++ b/src/hooks/useHandleTool.ts @@ -13,6 +13,7 @@ export default () => { const handleElement = canvas.getActiveObject() const templatesStore = useTemplatesStore() if (!handleElement) return + canvas.discardActiveObject() if (handleElement.type === ElementNames.ACTIVE) { const activeObject = handleElement as Group const activeObjectLeft = activeObject.left - activeObject.width / 2, activeObjectTop = activeObject.top - activeObject.height / 2 @@ -44,30 +45,31 @@ export default () => { } else { switch (command) { case AlignCommand.LEFT: - handleElement.set({left: left + handleElement.width / 2 }) + handleElement.set({left: left }) break case AlignCommand.RIGHT: - handleElement.set({left: left + width - handleElement.width / 2}) + handleElement.set({left: left + width - handleElement.width}) break case AlignCommand.TOP: - handleElement.set({top: top + handleElement.height / 2 }) + handleElement.set({top: top }) break case AlignCommand.BOTTOM: - handleElement.set({top: top + height - handleElement.height / 2}) + handleElement.set({top: top + height - handleElement.height}) break case AlignCommand.HORIZONTAL: - handleElement.set({left : centerPoint.x}) + handleElement.set({left : centerPoint.x - handleElement.width / 2}) break case AlignCommand.VERTICAL: - handleElement.set({top: centerPoint.y}) + handleElement.set({top: centerPoint.y - handleElement.height / 2}) break case AlignCommand.CENTER: - handleElement.set({left : centerPoint.x}) - handleElement.set({top: centerPoint.y}) + handleElement.set({left : centerPoint.x - handleElement.width / 2}) + handleElement.set({top: centerPoint.y - handleElement.height / 2}) break default: break } } + canvas.setActiveObject(handleElement) canvas.renderAll() templatesStore.modifedElement() }