Fit sprite size to the texture aspect ratio
Add ↔ next to Width and ↕ next to Height in the inspector. Each sets its field so the sprite matches the ratio of its assigned texture or frame, reading the frame's own rect rather than the sheet's. The buttons reuse the existing FieldActions convention, so they simply do not appear when no texture is assigned, when the sprite is already proportional, or on assets whose schema has no texture property. Comparison is a cross product with a relative tolerance: 3135 of the 40000 size pairs up to 200x200 do not survive a round trip through a division, so an exact check would leave the button standing after its own click. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4d84231b9f
commit
0b34bdd990
9 files changed
+412
-65
No files matched your search
@@ -17,6 +17,7 @@ import { menus } from './11-menus.mjs';
|
||||
import { textures } from './12-textures.mjs';
|
||||
import { frames } from './13-frames.mjs';
|
||||
import { overflow } from './14-overflow.mjs';
|
||||
import { aspect } from './15-aspect.mjs';
|
||||
|
||||
export const STEPS = [
|
||||
hierarchy,
|
||||
@@ -33,4 +34,5 @@ export const STEPS = [
|
||||
textures,
|
||||
frames,
|
||||
overflow,
|
||||
aspect,
|
||||
];
|
||||
Reference in new issue
Block a user