mirror of
https://github.com/markusfisch/BinaryEye.git
synced 2024-09-19 19:42:18 +02:00
Move origin subtraction out of min()
Simplifies the calculation of the width and height of the crop section.
This commit is contained in:
parent
11ae65ec3e
commit
96626e6b00
@ -64,8 +64,8 @@ fun Bitmap.crop(
|
||||
b,
|
||||
x,
|
||||
y,
|
||||
min(w - x, (rect.right * w).roundToInt() - x),
|
||||
min(h - y, (rect.bottom * h).roundToInt() - y)
|
||||
min(w, (rect.right * w).roundToInt()) - x,
|
||||
min(h, (rect.bottom * h).roundToInt()) - y
|
||||
)
|
||||
} catch (e: OutOfMemoryError) {
|
||||
null
|
||||
|
Loading…
Reference in New Issue
Block a user