Skip to content

Commit

Permalink
added panic when an image is loaded with a different canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
tfriedel6 committed Mar 21, 2020
1 parent f47d245 commit b39fdd0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions images.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ type Image struct {
func (cv *Canvas) LoadImage(src interface{}) (*Image, error) {
var reload *Image
if img, ok := src.(*Image); ok {
if img.cv != cv {
panic("image loaded with different canvas")
}
if img.deleted {
reload = img
src = img.src
Expand Down

0 comments on commit b39fdd0

Please sign in to comment.