adobe-photoshop / generator-assets

Generator Plug-in for Adobe Photoshop CC that helps users export image assets
MIT License
496 stars 86 forks source link

use exact bounds for all paths, #406

Closed pineapplespatula closed 8 years ago

pineapplespatula commented 8 years ago

since we cannot trust the bounds we get from the layer to be accurate with respect to the pixmap we get back from PS

in this case we get layer bounds that are ~30x32, while the image returned by PS is 30x34 since the bounds are not pixel aligned.

This Is a fix for https://github.com/adobe-photoshop/generator-assets/issues/350

chadrolfs commented 8 years ago

Will this clip or affect applied layer effects?

pineapplespatula commented 8 years ago

Objects with layer effects already use exact bounds. This will not change how items with layer effects are handled.

pineapplespatula commented 8 years ago

This may address https://github.com/adobe-photoshop/generator-assets/issues/404

mcilroyc commented 8 years ago

@pineapplespatula this change results in forcing exact bounds for a simple rectangle shape. If we can't approximate the bounds of a rectangle, then what can we approximate!? Is there really no way we can slice this more thinly?

iwehrman commented 8 years ago

Also, does this have a negative impact on performance?

pineapplespatula commented 8 years ago

we could revisit the padding logic inside of get pixmap params to handle fractional bounds more appropriately. I'll investigate that avenue

pineapplespatula commented 8 years ago

Yes, any move from approximate to exact bounds will impact performance for those cases. We should revisit calling bounds at all for a number of cases since we probably don't need to have the bounds before hand for a number of cases.

mcilroyc commented 8 years ago

closing this un-merged since 408 had an alternate fix