Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak TextureProgressBar NOTIFICATION_DRAW to support 9-patch stretch in radial modes #100697

Merged

Conversation

arkology
Copy link
Contributor

@arkology arkology commented Dec 21, 2024

The original reason for the changes - 9-patch stretching is ignored for under and over textures in radial modes.

  1. Code is splitted into 3 sections:
  • draw under texture;
  • draw progress texture + draw radial modes reference cross;
  • draw over texture.

Each draw texture section handles nine-patch stretching. Except for the progress texture in radial modes, which does not support nine-patch stretching (because it is not possible).

  1. The reference cross position now is not misaligned to real center position (floor() call removed).
  2. The reference cross drawing code is additionally surrounded by TOOLS_ENABLED check.

Preview "before-after":
NcnIPMH19e

@arkology arkology requested review from a team as code owners December 21, 2024 12:59
@arkology arkology force-pushed the texture-progress-radial-stretching branch from a7a2799 to eb09fa3 Compare December 21, 2024 13:05
@AThousandShips AThousandShips added this to the 4.x milestone Dec 21, 2024
…etch in radial modes

1) Code is splitted into 3 sections:
- draw `under` texture;
- draw `progress` texture + draw radial modes reference cross;
- draw `over` texture.
Each draw texture section handles nine-patch stretching. Except for the progress texture in radial modes, which does not support nine-patch stretching.
2) The reference cross position now is not misaligned to real center position (`floor()` call removed).
3) The reference cross drawing code is additionally surrounded by `TOOLS_ENABLED` check.
@arkology arkology force-pushed the texture-progress-radial-stretching branch from eb09fa3 to c46c3dd Compare January 12, 2025 18:42
@akien-mga akien-mga modified the milestones: 4.x, 4.4 Jan 13, 2025
@akien-mga akien-mga merged commit 20c09d2 into godotengine:master Jan 13, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@arkology arkology deleted the texture-progress-radial-stretching branch January 13, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants