Skip to content

Image.Set does not respect a subImage's boundaries. #2140

Answered by hajimehoshi
Goof512 asked this question in Q&A
Discussion options

You must be logged in to vote

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 subBox's left-upper position is (16, 16), (0, 0) is out of boundary of subBox. So nothing happens.

	//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 image.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Goof512
Comment options

@steampoweredtaco
Comment options

Answer selected by Goof512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2139 on June 13, 2022 06:22.