31
31
#include " texture_progress_bar.h"
32
32
33
33
#include " core/config/engine.h"
34
- #include " scene/resources/atlas_texture.h"
35
34
36
35
void TextureProgressBar::set_under_texture (const Ref<Texture2D> &p_texture) {
37
36
_set_texture (&under, p_texture);
@@ -513,15 +512,6 @@ void TextureProgressBar::_notification(int p_what) {
513
512
}
514
513
pts.push_back (to);
515
514
516
- Ref<AtlasTexture> atlas_progress = progress;
517
- bool valid_atlas_progress = atlas_progress.is_valid () && atlas_progress->get_atlas ().is_valid ();
518
- Rect2 region_rect;
519
- Size2 atlas_size;
520
- if (valid_atlas_progress) {
521
- region_rect = atlas_progress->get_region ();
522
- atlas_size = atlas_progress->get_atlas ()->get_size ();
523
- }
524
-
525
515
Vector<Point2> uvs;
526
516
Vector<Point2> points;
527
517
for (const float &f : pts) {
@@ -530,21 +520,13 @@ void TextureProgressBar::_notification(int p_what) {
530
520
continue ;
531
521
}
532
522
points.push_back (progress_offset + Point2 (uv.x * s.x , uv.y * s.y ));
533
- if (valid_atlas_progress) {
534
- uv.x = Math::remap (uv.x , 0 , 1 , region_rect.position .x / atlas_size.x , (region_rect.position .x + region_rect.size .x ) / atlas_size.x );
535
- uv.y = Math::remap (uv.y , 0 , 1 , region_rect.position .y / atlas_size.y , (region_rect.position .y + region_rect.size .y ) / atlas_size.y );
536
- }
537
523
uvs.push_back (uv);
538
524
}
539
525
540
526
// Filter out an edge case where almost equal `from`, `to` were mapped to the same UV.
541
527
if (points.size () >= 2 ) {
542
528
Point2 center_point = get_relative_center ();
543
529
points.push_back (progress_offset + s * center_point);
544
- if (valid_atlas_progress) {
545
- center_point.x = Math::remap (center_point.x , 0 , 1 , region_rect.position .x / atlas_size.x , (region_rect.position .x + region_rect.size .x ) / atlas_size.x );
546
- center_point.y = Math::remap (center_point.y , 0 , 1 , region_rect.position .y / atlas_size.y , (region_rect.position .y + region_rect.size .y ) / atlas_size.y );
547
- }
548
530
uvs.push_back (center_point);
549
531
550
532
Vector<Color> colors;
0 commit comments