wikipathways / wikipathways-development

Roadmap planning, developer documentation, contribution guidelines
2 stars 0 forks source link

Rotated graphical objects are rendered with incorrect placement (centerX) and sizing #121

Closed khanspers closed 1 year ago

khanspers commented 1 year ago

Pathways with graphical objects that have been rotated from the default end up having an incorrect CenterX placement and incorrect overall size at WikiPatwhays, even though the gpml is correct.

In the following pathway, the golgi in the middle column (bottom) has been rotated, and WP is placing it too far to the left. All 3 golgi also have a different size than in PV. See comparison between WP and what it looks like in PV below.

In PathVisio:

Screen Shot 2023-03-28 at 11 03 50 AM

In WikiPathways (screenshot from classic): Screen Shot 2023-03-28 at 11 06 37 AM

I have confirmed that PathVisio (3.3.0) is saving the gpml correctly and that the gpml at WP also has the correct coordinates. It seems to be a rendering bug.

Links here are for classic WP, but this is a problem on the new site too. Here's an example (note the golgi placement and size): WP3676

https://classic.wikipathways.org/index.php/Pathway:WP5350

hasanbalci commented 1 year ago

I experimented a bit with the viewBox property of the Golgi svg and if I change it from "0 0 100 100" to "0 0 100 150", I obtain the following result: This is how it looks like in PathVisio:

pv

This is the conversion from gpml to svg with "0 0 100 150":

convert150

This is the current conversion from gpml to svg with "0 0 100 100":

convert100

This is not a precise solution but I think it at least generates better images.

khanspers commented 1 year ago

Fantastic, that's a lot better than the current behavior. So the fix would be in the svg rendering code?

hasanbalci commented 1 year ago

Yes, I will make the change in the svg image of Golgi.

AlexanderPico commented 1 year ago

@hasanbalci Close this one too?