parent
11260fb87f
commit
439e0027ec
@ -2027,8 +2027,7 @@ Rect2 Image::get_used_rect() const {
|
|||||||
for (int j = 0; j < height; j++) {
|
for (int j = 0; j < height; j++) {
|
||||||
for (int i = 0; i < width; i++) {
|
for (int i = 0; i < width; i++) {
|
||||||
|
|
||||||
bool opaque = get_pixel(i, j).a > 0.99;
|
if (!(get_pixel(i, j).a > 0))
|
||||||
if (!opaque)
|
|
||||||
continue;
|
continue;
|
||||||
if (i > maxx)
|
if (i > maxx)
|
||||||
maxx = i;
|
maxx = i;
|
||||||
|
@ -285,7 +285,7 @@
|
|||||||
<return type="Rect2">
|
<return type="Rect2">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
Returns a [Rect2] enclosing the visible portion of the image.
|
Returns a [Rect2] enclosing the visible portion of the image, considering each pixel with a non-zero alpha channel as visible.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_width" qualifiers="const">
|
<method name="get_width" qualifiers="const">
|
||||||
|
Loading…
Reference in New Issue
Block a user