summaryrefslogtreecommitdiffstats
path: root/scene/gui/texture_progress_bar.cpp
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2021-09-25 14:46:45 +0545
committerAnilforextra <anilforextra@gmail.com>2021-09-25 14:46:45 +0545
commitcdd912c48eab15f581459afc2cda8fdcfabf92db (patch)
treed2d4ce59b2e55c8947103fc40ce1258728a8dc65 /scene/gui/texture_progress_bar.cpp
parent5e4a71200e25811d8e570d87f08f0878dabb8bb9 (diff)
downloadredot-engine-cdd912c48eab15f581459afc2cda8fdcfabf92db.tar.gz
Construct values only when necessary.
Diffstat (limited to 'scene/gui/texture_progress_bar.cpp')
-rw-r--r--scene/gui/texture_progress_bar.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/scene/gui/texture_progress_bar.cpp b/scene/gui/texture_progress_bar.cpp
index 286f01ee33..35a098c6fd 100644
--- a/scene/gui/texture_progress_bar.cpp
+++ b/scene/gui/texture_progress_bar.cpp
@@ -471,7 +471,7 @@ void TextureProgressBar::_notification(int p_what) {
Vector<Point2> uvs;
Vector<Point2> points;
uvs.push_back(get_relative_center());
- points.push_back(progress_offset + Point2(s.x * get_relative_center().x, s.y * get_relative_center().y));
+ points.push_back(progress_offset + s * get_relative_center());
for (int i = 0; i < pts.size(); i++) {
Point2 uv = unit_val_to_uv(pts[i]);
if (uvs.find(uv) >= 0) {
@@ -493,8 +493,7 @@ void TextureProgressBar::_notification(int p_what) {
p = progress->get_size();
}
- p.x *= get_relative_center().x;
- p.y *= get_relative_center().y;
+ 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);