aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library_sdl.js8
-rwxr-xr-xtests/runner.py3
-rw-r--r--tests/sdl_gfx_primitives.pngbin0 -> 2357 bytes
3 files changed, 7 insertions, 4 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 32e801bb..439a974a 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -1764,9 +1764,9 @@ var LibrarySDL = {
surfData.ctx.save();
surfData.ctx.beginPath();
- surfData.ctx.scale(rx, ry);
surfData.ctx.translate(x, y);
- surfData.ctx.arc(1, 1, 1, 0, 2 * Math.PI);
+ surfData.ctx.scale(rx, ry);
+ surfData.ctx.arc(0, 0, 1, 0, 2 * Math.PI);
surfData.ctx.restore();
surfData.ctx.save();
@@ -1781,7 +1781,7 @@ var LibrarySDL = {
},
ellipseRGBA__deps: ['_drawEllipse'],
- ellipseRGBA: function(surf, x, y, rx, ry, color) {
+ ellipseRGBA: function(surf, x, y, rx, ry, r, g, b, a) {
return __drawEllipse(surf, x, y, rx, ry, 'stroke', SDL.translateRGBAToCSSRGBA(r, g, b, a));
},
@@ -1791,7 +1791,7 @@ var LibrarySDL = {
},
filledEllipseRGBA__deps: ['_drawEllipse'],
- filledEllipseRGBA: function(surf, x, y, rx, ry, color) {
+ filledEllipseRGBA: function(surf, x, y, rx, ry, r, g, b, a) {
return __drawEllipse(surf, x, y, rx, ry, 'fill', SDL.translateRGBAToCSSRGBA(r, g, b, a));
},
diff --git a/tests/runner.py b/tests/runner.py
index ddef3568..722f8130 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -13186,6 +13186,9 @@ Press any key to continue.'''
shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png'))
self.btest('sdl_rotozoom.c', reference='sdl_rotozoom.png', args=['--preload-file', 'screenshot.png'], reference_slack=3)
+ def test_sdl_gfx_primitives(self):
+ self.btest('sdl_gfx_primitives.c', reference='sdl_gfx_primitives.png', reference_slack=3)
+
def test_sdl_canvas_palette_2(self):
open(os.path.join(self.get_dir(), 'pre.js'), 'w').write('''
Module['preRun'].push(function() {
diff --git a/tests/sdl_gfx_primitives.png b/tests/sdl_gfx_primitives.png
new file mode 100644
index 00000000..525b4f8f
--- /dev/null
+++ b/tests/sdl_gfx_primitives.png
Binary files differ