Skip to content

[Bug]: Grouping svg elements not considering viewport width and height #10916

@manimozhiyan-ephoreal

Description

@manimozhiyan-ephoreal

Before submitting

  • I agree to follow this project's Code of Conduct
  • I searched existing issues and discussions

Version

6.0.0

Environment

Firefox

Link To Reproduction

No response

Steps To Reproduce

  1. Create a SVG with some unwanted element on off the viewport( usually we put unwanted svg element off the canva in Inkscape instead of deleting since it won't show in export)
  2. Uploading the SVG in Canva using groupSVGElement (pass elements within svg as array to group)

Expected Behavior

  • Just group element instead of recalculating, setting layout and aligning center.
  • Add the svg as it is to the canva since canva and svg width height are same.
  • Work as worked in Fabric 5

Put svg on canva as it is (fabric 5) : Image

Actual Behavior

It recalculates width and height including all unwanted svg element which are not within the viewport and aligning center of canvas

  • Even if I stop recalculating with group._shouldPerformLayout = false, it aligns the svg center of canva.

aligns center even after controlling layout : Image

Additional Context

  • summarizing : i want Group to group my svg array as it grouped it in fabric js 5 ( no layout, no aligning, considering viewport, keep svg as designed)
    Hope you understood my case, thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions