Skip to content

Additional trimming and padding options#235

Open
aidenfoxx wants to merge 7 commits intoantipalindrome:mainfrom
aidenfoxx:aidenfoxx/trim-options
Open

Additional trimming and padding options#235
aidenfoxx wants to merge 7 commits intoantipalindrome:mainfrom
aidenfoxx:aidenfoxx/trim-options

Conversation

@aidenfoxx
Copy link

@aidenfoxx aidenfoxx commented Sep 16, 2023

Description

Adds the ability to:

  • Constrain the trim operation to a specific axis ("Horizontal" or "Vertical"), defaulting to "Both"
  • Separately specify the X and Y values of the padding option

The impetus for the change was to enable better exporting of game assets such as text, where the height may need to remain the same, but the width should be constrained to the content.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • This change requires a documentation update

image

Comment on lines +3555 to -3458
var lblContact = dialog.add("group", undefined , {name: "lblContact"});
lblContact.getText = function() { var t=[]; for ( var n=0; n<lblContact.children.length; n++ ) { var text = lblContact.children[n].text || ''; if ( text === '' ) text = ' '; t.push( text ); } return t.join('\n'); };
lblContact.orientation = "column";
lblContact.alignChildren = ["center","center"];
lblContact.spacing = 0;

lblContact.add("statictext", undefined, "To get the most recent version, or leave feedback, go to:", {name: "lblContact"});
lblContact.add("statictext", undefined, "https://github.com/antipalindrome/Photoshop-Export-Layers-to-Files-Fast", {name: "lblContact"});
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this changed when importing the updated UI.

var scaleNum = parseInt(this.text, 10);
if (isNaN(scaleNum)) {
scaleNum = prefs.paddingValue;
scaleNum = prefs.scaleValue;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this was previously a copypasta mistake?

@aidenfoxx aidenfoxx marked this pull request as ready for review September 16, 2023 17:01
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

Successfully merging this pull request may close these issues.

1 participant