[Feature]: why left and top property is not in selected object when their is multiple object selected in selection:created event? #9771
Unanswered
niketaOptimumnbrew
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
CheckList
Description
I'm migrating fabric.js version from 1.7.22 to version 5.3.0
when multiple object is selected then I'm getting below object at selection:created event:(version 5.3.0)
{ "e": { "isTrusted": true }, "selected": [ { "type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": -206.5, "top": -156.93, "width": 200, "height": 313.87, "fill": "#000000", "stroke": "#ffffff", "strokeWidth": 0, "strokeDashArray": null, "strokeLineCap": "butt", "strokeDashOffset": 0, "strokeLineJoin": "miter", "strokeUniform": false, "strokeMiterLimit": 4, "scaleX": 1, "scaleY": 1, "angle": 0, "flipX": false, "flipY": false, "opacity": 1, "shadow": { "color": "#000000", "blur": 0, "offsetX": 0, "offsetY": 0, "affectStroke": false, "nonScaling": false }, "visible": true, "backgroundColor": "", "fillRule": "nonzero", "paintFirst": "fill", "globalCompositeOperation": "source-over", "skewX": 0, "skewY": 0, "fontFamily": "Roboto-Regular", "fontWeight": "bold", "fontSize": 62, "text": "ADD HEADING TEXT", "underline": false, "overline": false, "linethrough": false, "textAlign": "left", "fontStyle": "normal", "lineHeight": 1.16, "textBackgroundColor": "", "charSpacing": 0, "styles": [], "direction": "ltr", "path": null, "pathStartOffset": 0, "pathSide": "left", "pathAlign": "baseline", "minWidth": 20, "splitByGrapheme": true, "customSourceType": "text_json", "bg_image": "", "texture_image": "", "id": 499538 }, { "type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 6.5, "top": -110.6, "width": 200, "height": 95.19, "fill": "#000000", "stroke": "#ffffff", "strokeWidth": 0, "strokeDashArray": null, "strokeLineCap": "butt", "strokeDashOffset": 0, "strokeLineJoin": "miter", "strokeUniform": false, "strokeMiterLimit": 4, "scaleX": 1, "scaleY": 1, "angle": 0, "flipX": false, "flipY": false, "opacity": 1, "shadow": { "color": "#000000", "blur": 0, "offsetX": 0, "offsetY": 0, "affectStroke": false, "nonScaling": false }, "visible": true, "backgroundColor": "", "fillRule": "nonzero", "paintFirst": "fill", "globalCompositeOperation": "source-over", "skewX": 0, "skewY": 0, "fontFamily": "Roboto-Regular", "fontWeight": "bold", "fontSize": 39, "text": "Add SubHeading Text", "underline": false, "overline": false, "linethrough": false, "textAlign": "left", "fontStyle": "normal", "lineHeight": 1.16, "textBackgroundColor": "", "charSpacing": 0, "styles": [], "direction": "ltr", "path": null, "pathStartOffset": 0, "pathSide": "left", "pathAlign": "baseline", "minWidth": 20, "splitByGrapheme": true, "customSourceType": "text_json", "bg_image": "", "texture_image": "", "id": 763213 } ] }
Json with multiple object selected at selection:created event(version 1.7.22)
{ "target": { "type": "group", "originX": "left", "originY": "top", "left": 129, "top": 183, "width": 391, "height": 151, "fill": "rgb(0,0,0)", "stroke": null, "strokeWidth": 0, "strokeDashArray": null, "strokeLineCap": "butt", "strokeLineJoin": "miter", "strokeMiterLimit": 10, "scaleX": 1, "scaleY": 1, "angle": 0, "flipX": false, "flipY": false, "opacity": 1, "shadow": null, "visible": true, "clipTo": null, "backgroundColor": "", "fillRule": "nonzero", "globalCompositeOperation": "source-over", "transformMatrix": null, "skewX": 0, "skewY": 0, "objects": [ { "type": "i-text", "originX": "left", "originY": "top", "left": -195.5, "top": -75.5, "width": 391, "height": 49, "fill": "#000000", "stroke": "#ffffff", "strokeWidth": 0, "strokeDashArray": null, "strokeLineCap": "butt", "strokeLineJoin": "miter", "strokeMiterLimit": 10, "scaleX": 1, "scaleY": 1, "angle": 0, "flipX": false, "flipY": false, "opacity": 1, "shadow": { "color": "#000000", "blur": 0, "offsetX": 0, "offsetY": 0, "affectStroke": false }, "visible": true, "clipTo": null, "backgroundColor": "", "fillRule": "nonzero", "globalCompositeOperation": "source-over", "transformMatrix": null, "skewX": 0, "skewY": 0, "text": "ADD HEADING TEXT", "fontSize": 43, "fontWeight": "bold", "fontFamily": "Roboto-Regular", "fontStyle": "", "lineHeight": 1.16, "textDecoration": "", "textAlign": "left", "textBackgroundColor": "", "charSpacing": 0, "excludeFromExport": false, "_controlsVisibility": { "tl": true, "tr": true, "br": true, "bl": true, "ml": false, "mt": false, "mr": false, "mb": false, "mtr": true }, "isLocked": false, "styles": {}, "customSourceType": "text_json", "bg_image": "", "texture_image": "", "id": 644624 }, { "type": "i-text", "originX": "left", "originY": "top", "left": -182.5, "top": 37.5, "width": 328, "height": 38, "fill": "#000000", "stroke": "#ffffff", "strokeWidth": 0, "strokeDashArray": null, "strokeLineCap": "butt", "strokeLineJoin": "miter", "strokeMiterLimit": 10, "scaleX": 1, "scaleY": 1, "angle": 0, "flipX": false, "flipY": false, "opacity": 1, "shadow": { "color": "#000000", "blur": 0, "offsetX": 0, "offsetY": 0, "affectStroke": false }, "visible": true, "clipTo": null, "backgroundColor": "", "fillRule": "nonzero", "globalCompositeOperation": "source-over", "transformMatrix": null, "skewX": 0, "skewY": 0, "text": "Add SubHeading Text", "fontSize": 34, "fontWeight": "bold", "fontFamily": "Roboto-Regular", "fontStyle": "", "lineHeight": 1.16, "textDecoration": "", "textAlign": "left", "textBackgroundColor": "", "charSpacing": 0, "excludeFromExport": false, "_controlsVisibility": { "tl": true, "tr": true, "br": true, "bl": true, "ml": false, "mt": false, "mr": false, "mb": false, "mtr": true }, "isLocked": false, "styles": {}, "customSourceType": "text_json", "bg_image": "", "texture_image": "", "id": 871631 } ] }, "e": { "isTrusted": true } }
Current State
In fabric.js latest version(5.3.0) not getting left and top property in selected object at selection:created event.
Additional Context
Can anyone please tell me that what I'm missing? or Is their any issue in selection:created event?
Beta Was this translation helpful? Give feedback.
All reactions