-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
TextureProgress: progress_offset
now added to relative center
#55377
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a right fix. E.g. here
godot/scene/gui/texture_progress_bar.cpp
Lines 478 to 479 in 52b7d5f
uvs.push_back(get_relative_center()); | |
points.push_back(progress_offset + s * get_relative_center()); |
the
progress_offset
is added to the relative center, so it's applied twice.
I'd instead adjust only the cross position, so add the offset somewhere here:
godot/scene/gui/texture_progress_bar.cpp
Lines 495 to 506 in 52b7d5f
Point2 p; | |
if (nine_patch_stretch) { | |
p = get_size(); | |
} else { | |
p = progress->get_size(); | |
} | |
p *= get_relative_center(); | |
p = p.floor(); | |
draw_line(p - Point2(8, 0), p + Point2(8, 0), Color(0.9, 0.5, 0.5), 2); | |
draw_line(p - Point2(0, 8), p + Point2(0, 8), Color(0.9, 0.5, 0.5), 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, but you need to squash your commits.
@KoBeWi |
Thanks! |
Cherry-picked for 3.5. |
Cherry-picked for 3.4.1. |
progress_offset
now added to relative centerprogress_offset
now added to relative center
progress_offset
of TextureProgress wasn't moving the reference cross. Hopefully this would fix it.fixes #55338