Skip to content

Conversation

@stoopipoopy
Copy link
Contributor

This PR fixes #2576 where the "Sides" and "Line Count" column in the Parachute Component panel sort lexically instead of numerically.

The problem was in ComponentPresetTable. During column initialization, the sorter did not have a special case for Integers as it did for Doubles and Booleans. This caused it to sort Integers like Strings instead of numbers because there was no base case other than the default.

The issue was fixed by adding a simple special case, just like the Booleans or Doubles, that handles Integers separately than all other Objects.

Copy link
Contributor

@JoePfeiffer JoePfeiffer left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good.

One small thing is we do prefer to import the classes individually, rather than using a wildcard.

@stoopipoopy
Copy link
Contributor Author

Fixed.

@JoePfeiffer JoePfeiffer merged commit 3499ba4 into openrocket:unstable Oct 17, 2024
@SiboVG
Copy link
Member

SiboVG commented Oct 17, 2024

Thanks for the change @stoopipoopy!

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.

[Bug] Both the "Sides" column and the "Line Count" column in the Parachute Component panel do not sort correctly

3 participants