EsotericSoftware / spine-editor

Issue tracking for the Spine editor.
http://esotericsoftware.com/
28 stars 2 forks source link

Renaming or duplicating a sequence attachment removes space at the end of the image path #813

Open misaki-eymard opened 2 weeks ago

misaki-eymard commented 2 weeks ago

Description: If the images that make up a sequence attachment are named Layer 1, Layer 2, Layer 3, or something like name + space + number, changing the attachment name or duplicating the attachment removes the last space in the image path and breaks the reference. This is a bit annoying and should be corrected to keep the trailing spaces.

Expected behavior: The space at the end of the image path is retained even after renaming or duplicating an attachment.

Steps to reproduce:

  1. Download the attached .zip file: Renaming or duplicating a sequence attachment removes space at the end of the image path.zip
  2. In the tree view, double-click on the name of the attachment "muzzle" to bring up the renaming dialog. muzzle
  3. Press OK to close it without making any changes. rename
  4. Then you can see that the attachment is missing and the image path is changed from <muzzle > to <muzzle>. Screenshot 2024-07-05 at 18 39 02

The version of Spine in which this problem was found: Spine 4.2.33

This problem was reported in the following thread on the forum: https://esotericsoftware.com/forum/d/26472-sequence-attachment-trims-the-space-at-the-end-of-the-name

NathanSweet commented 1 week ago

So far our stance on all names is to strip whitespace characters at the start and end. They can't be seen and it's easy to be confused about why something doesn't work. It may be better to continue that and users should not use invisible space characters in the base part of their names.

I'll leave this open as an enhancement. We could toast a warning when whitespace is stripped and the attachment has a sequence.