diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-03-24 12:28:46 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-03-24 12:28:46 -0700 |
commit | 63af5eac0a10434cc62244d80675f13473d38b02 (patch) | |
tree | fccf970096feb1467ab20bae5a6f6e770995adb7 /src/library_sdl.js | |
parent | 61443c611846804a38c8a97319f6ebe708ef73bc (diff) |
fix SDL gfx rectangles
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r-- | src/library_sdl.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index d37527de..4c21394f 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -777,9 +777,9 @@ mergeInto(LibraryManager.library, { boxRGBA: function(surf, x1, y1, x2, y2, r, g, b, a) { var surfData = SDL.surfaces[surf]; assert(!surfData.locked); // but we could unlock and re-lock if we must.. - // XXX save and restore ctx state here and similar places? + // TODO: if ctx does not change, leave as is, and also do not re-set xStyle etc. surfData.ctx.save(); - surfData.ctx.strokeStyle = surfData.ctx.fillStyle = SDL.translateRGBAToCSS(r, g, b, a); + surfData.ctx.fillStyle = SDL.translateRGBAToCSS(r, g, b, a); surfData.ctx.fillRect(x1, y1, x2-x1, y2-y1); surfData.ctx.restore(); }, @@ -787,10 +787,9 @@ mergeInto(LibraryManager.library, { rectangleRGBA: function(surf, x1, y1, x2, y2, r, g, b, a) { var surfData = SDL.surfaces[surf]; assert(!surfData.locked); // but we could unlock and re-lock if we must.. - // XXX save and restore ctx state here and similar places? surfData.ctx.save(); surfData.ctx.strokeStyle = SDL.translateRGBAToCSS(r, g, b, a); - surfData.ctx.fillRect(x1, y1, x2-x1, y2-y1); + surfData.ctx.strokeRect(x1, y1, x2-x1, y2-y1); surfData.ctx.restore(); }, |