Image.Set does not respect a subImage's boundaries. #2140
-
Beta Was this translation helpful? Give feedback.
Answered by
hajimehoshi
Jun 13, 2022
Replies: 1 comment 2 replies
-
Hi, This seems an expected behavior. //but here we can't write to that corner directly
subBox.Set(0, 0, color.RGBA{0x00, 0xFF, 0x90, 0xFF}) As //and this shouldn't work at all. This should be out of bounds for the sub-image
subBox.Set(40, 40, color.White) This should work as (40, 40) is in the boundary (16,16)-(48,48). This behavior should be the same as the standard library |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Goof512
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
This seems an expected behavior.
As
subBox
's left-upper position is (16, 16), (0, 0) is out of boundary ofsubBox
. So nothing happens.This should work as (40, 40) is in the boundary (16,16)-(48,48).
This behavior should be the same as the standard library
image
.