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

TextureProgress: progress_offset now added to relative center #55377

Merged
merged 1 commit into from
Nov 29, 2021
Merged

TextureProgress: progress_offset now added to relative center #55377

merged 1 commit into from
Nov 29, 2021

Conversation

RedHeadphone
Copy link
Contributor

progress_offset of TextureProgress wasn't moving the reference cross. Hopefully this would fix it.

fixes #55338

@RedHeadphone RedHeadphone requested a review from a team as a code owner November 27, 2021 07:23
@YeldhamDev YeldhamDev added this to the 4.0 milestone Nov 27, 2021
@YeldhamDev YeldhamDev added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Nov 27, 2021
Copy link
Member

@KoBeWi KoBeWi left a 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

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:

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);

Copy link
Member

@KoBeWi KoBeWi left a 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.

@RedHeadphone
Copy link
Contributor Author

RedHeadphone commented Nov 28, 2021

@KoBeWi
I squashed the commits

@akien-mga akien-mga merged commit 9c116fc into godotengine:master Nov 29, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

akien-mga commented Nov 29, 2021

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Nov 29, 2021
@akien-mga
Copy link
Member

Cherry-picked for 3.4.1.

@akien-mga akien-mga changed the title progress_offset now added to relative center TextureProgress: progress_offset now added to relative center Dec 8, 2021
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.

progress_offset of TextureProgressBar doesn't move the reference cross
5 participants