Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculating Width and Height of Shape from PSD Data #167

Open
AlaaBol opened this issue Mar 25, 2024 · 3 comments
Open

Calculating Width and Height of Shape from PSD Data #167

AlaaBol opened this issue Mar 25, 2024 · 3 comments
Assignees

Comments

@AlaaBol
Copy link

AlaaBol commented Mar 25, 2024

Could you please provide guidance on the correct method for calculating the width and height of a shape from the PSD data? Specifically, should I use the bounding box coordinates or the vertices of the shape for this calculation?

03-19-48-DESKTOP-6L1HFJK-Administrator-Access-Getscreen-me

@Agamnentzar Agamnentzar self-assigned this Mar 25, 2024
@Agamnentzar
Copy link
Owner

Vertices of the shape will not give you correct bounds because bezier curves can extend beyond position of the points. You can probably use bounding box coordinates if you don't plan on modifying the shape. Otherwise you'll have to somehow calculate bounds for each bezier curve and pick maximum extents from that. I don't know how to calculate it but calculating bounds of bezier curve should be a common problem that has some solutions online.

@AlaaBol
Copy link
Author

AlaaBol commented Mar 26, 2024

Thank you for your response.
Simply obtaining the width and height of a shape from the bounding vertices isn't giving correct results. This is because when the shape is rotated, the bounding box tends to expand, potentially distorting the actual dimensions of the shape itself. What alternative methods or adjustments would you suggest to accurately determine the width and height of the shape, especially considering rotations?

@Agamnentzar
Copy link
Owner

I'm not really familiar with your problem and don't really know what's the best approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants