Skip to content

Commit d84aecf

Browse files
moxvallixJosh-Cena
andauthored
drawImage: negative width/height does not flip the image (mdn#40695)
* Remove incorrect information from drawImage docs (mdn#37873). Negative sWidth and sHeight do not actually flip the resulting image, removed the lines that claimed they do. See mdn#37873. * Update drawImage information based on feedback from review. * Update index.md * Update index.md --------- Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
1 parent a8c3a70 commit d84aecf

File tree

1 file changed

+4
-2
lines changed
  • files/en-us/web/api/canvasrenderingcontext2d/drawimage

1 file changed

+4
-2
lines changed

files/en-us/web/api/canvasrenderingcontext2d/drawimage/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight)
4646
destination context. If not specified, the entire rectangle from the coordinates
4747
specified by `sx` and `sy` to the bottom-right corner of the
4848
image is used. Use the 3- or 5-argument syntax to omit this argument.
49-
A negative value will flip the image.
49+
Negative values grow the sub-rectangle in the opposite direction, but pixels are always processed in the original direction and the image is not flipped.
5050
- `sHeight` {{optional_inline}}
5151
- : The height of the sub-rectangle of the source `image` to draw into the
5252
destination context. Use the 3- or 5-argument syntax to omit this argument.
53-
A negative value will flip the image.
53+
Negative values grow the sub-rectangle in the opposite direction, but pixels are always processed in the original direction and the image is not flipped.
5454
- `dx`
5555
- : The x-axis coordinate in the destination canvas at which to place the top-left
5656
corner of the source `image`.
@@ -61,10 +61,12 @@ drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight)
6161
- : The width to draw the `image` in the destination canvas. This allows
6262
scaling of the drawn image. If not specified, the image is not scaled in width when
6363
drawn. Note that this argument is not included in the 3-argument syntax.
64+
Negative values grow the sub-rectangle in the opposite direction, but pixels are always processed in the original direction and the image is not flipped.
6465
- `dHeight`
6566
- : The height to draw the `image` in the destination canvas. This allows
6667
scaling of the drawn image. If not specified, the image is not scaled in height when
6768
drawn. Note that this argument is not included in the 3-argument syntax.
69+
Negative values grow the sub-rectangle in the opposite direction, but pixels are always processed in the original direction and the image is not flipped.
6870

6971
### Return value
7072

0 commit comments

Comments
 (0)