Initial implementation of containerBehavior.margin

This commit is contained in:
zsviczian
2025-11-01 11:48:26 +00:00
parent 0ff0efe2a7
commit d668eaa060
12 changed files with 312 additions and 91 deletions
+12 -4
View File
@@ -329,16 +329,24 @@ const generateElementCanvas = (
boundTextCanvasContext.translate(-shiftX, -shiftY);
// Clear the bound text area
boundTextCanvasContext.clearRect(
-(boundTextElement.width / 2 + BOUND_TEXT_PADDING) *
-(
boundTextElement.width / 2 +
(element.containerBehavior?.margin ?? BOUND_TEXT_PADDING)
) *
window.devicePixelRatio *
scale,
-(boundTextElement.height / 2 + BOUND_TEXT_PADDING) *
-(
boundTextElement.height / 2 +
(element.containerBehavior?.margin ?? BOUND_TEXT_PADDING)
) *
window.devicePixelRatio *
scale,
(boundTextElement.width + BOUND_TEXT_PADDING * 2) *
(boundTextElement.width +
(element.containerBehavior?.margin ?? BOUND_TEXT_PADDING) * 2) *
window.devicePixelRatio *
scale,
(boundTextElement.height + BOUND_TEXT_PADDING * 2) *
(boundTextElement.height +
(element.containerBehavior?.margin ?? BOUND_TEXT_PADDING) * 2) *
window.devicePixelRatio *
scale,
);