Skip to content

Different transform results than browser #113

Open
@cyberwombat

Description

@cyberwombat

I am migrating a complex browser based SVG generator to use SVGDOM and have it working 99%. There is one spot however where the transform calculations are different and wondering if you think it might be a bug or if there is something I am missing.

I have an element and applying the following action:[]

this.el.transform({
  scaleX: 0.25,
  scaleY:  0.25,
})

The "coordinates" data before the transform is the same but the result is different - For ex notice the "f" and "translateY" parameters.

Browser:

Before transform:

{
  "scaleX": 0.25,
  "scaleY": 0.25,
  "shear": 0,
  "rotate": 0,
  "translateX": 987,
  "translateY": 182,
  "originX": 0,
  "originY": 0,
  "a": 0.25,
  "b": 0,
  "c": 0,
  "d": 0.25,
  "e": 987,
  "f": 182
}

After:

{
  "scaleX": 0.25,
  "scaleY": 0.25,
  "shear": 0,
  "rotate": 0,
  "translateX": 0,
  "translateY": 0,
  "originX": 0,
  "originY": 0,
  "a": 0.25,
  "b": 0,
  "c": 0,
  "d": 0.25,
  "e": 0,
  "f": 0
}

SVGDom:
Before transform:

{
  scaleX: 0.25,
  scaleY: 0.25,
  shear: 0,
  rotate: 0,
  translateX: 987,
  translateY: 182,
  originX: 0,
  originY: 0,
  a: 0.25,
  b: 0,
  c: 0,
  d: 0.25,
  e: 987,
  f: 182
}

After transform:

{
  scaleX: 0.25,
  scaleY: 0.25,
  shear: 0,
  rotate: 0,
  translateX: 0,
  translateY: -20.9765625,
  originX: 0,
  originY: 0,
  a: 0.25,
  b: 0,
  c: 0,
  d: 0.25,
  e: 0,
  f: -20.9765625
}

I have tried this with 0.1.14 as well as current master with same result.

Happy to provide additional data. Do you have an idea what issue could be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions