You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we specify a region using the setRegion method of palette builder, the region internally is always set as a full bitmap.
I think the issue is this code
publicfunsetRegion(left:Int, top:Int, right:Int, bottom:Int): Builder {
val bitmap = imageBitmap
if (bitmap !=null) {
if (region ==null) {
region =Rect(0f, 0f, bitmap.width.toFloat(), bitmap.height.toFloat())
}
// Now just get the intersection with the regionval other =Rect(left.toFloat(), top.toFloat(), right.toFloat(), bottom.toFloat())
if (!region!!.overlaps(other)) {
throwIllegalArgumentException("The given region must intersect with "+"the Bitmap's dimensions.")
}
}
returnthis
}
When we set a region, it should be initialised as region = Rect(left, top, right, bottom)
Let me know if I am incorrect or if there is a way to fix it.
The text was updated successfully, but these errors were encountered:
I'm currently focused on #207 in the time I have to work on this project. So unfortunately this issue isn't on my radar currently. Feel free to submit a PR if you'd like. 🙌
When we specify a region using the
setRegion
method of palette builder, the region internally is always set as a full bitmap.I think the issue is this code
When we set a region, it should be initialised as
region = Rect(left, top, right, bottom)
Let me know if I am incorrect or if there is a way to fix it.
The text was updated successfully, but these errors were encountered: