Skip to content

Commit 582082e

Browse files
Gasparokendacap
authored andcommitted
Add 'Image(image, rectangle)' may return nil
1 parent bae03ed commit 582082e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/image.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ The `spec` parameter is an [image specification](imagespec.md#imagespec) object.
3131
If you specify `otherImage`, it's equivalent to use
3232
[`otherImage:clone()`](#imageclone). If you specify `Image(otherImage, rectangle)`
3333
this will create a copy of the specified
34-
[rectangle](rectangle.md#rectangle) of `otherImage`.
34+
[rectangle](rectangle.md#rectangle) of `otherImage`. `Image(otherImage, rectangle)`
35+
may return `nil` if the [rectangle](rectangle.md#rectangle) is empty
36+
(i.e., if its width and/or height are equal to or less than zero).
3537

3638
If a `sprite` is given, the image will be a render of the first frame
3739
of the [sprite](sprite.md#sprite). Note: You can use

0 commit comments

Comments
 (0)