Skip to content

Commit f450405

Browse files
committed
Merge branch 'fix-rotozoom' of github.com:fhd/emscripten into incoming
2 parents ae7378a + 6340c6d commit f450405

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

src/library_sdl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ var LibrarySDL = {
11221122
var ret = SDL.makeSurface(diagonal, diagonal, srcData.flags, false, 'rotozoomSurface');
11231123
var dstData = SDL.surfaces[ret];
11241124
dstData.ctx.translate(diagonal / 2, diagonal / 2);
1125-
dstData.ctx.rotate(angle * Math.PI / 180);
1125+
dstData.ctx.rotate(-angle * Math.PI / 180);
11261126
dstData.ctx.drawImage(srcData.canvas, -w / 2, -h / 2, w, h);
11271127
return ret;
11281128
},

tests/sdl_rotozoom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int main(int argc, char **argv) {
3838
sprite[2] = zoomSurface(sprite[0], 0.5, 0.5, SMOOTHING_ON);
3939
sprite[3] = zoomSurface(sprite[1], 0.5, 0.5, SMOOTHING_ON);
4040
sprite[4] = rotozoomSurface(sprite[0], -20, 0.3, SMOOTHING_ON);
41-
sprite[5] = rotozoomSurface(sprite[1], 45, 0.5, SMOOTHING_ON);
41+
sprite[5] = rotozoomSurface(sprite[1], 20, 1, SMOOTHING_ON);
4242
sprite[6] = zoomSurface(sprite[0], -0.5, 0.5, SMOOTHING_ON);
4343
sprite[7] = zoomSurface(sprite[0], -0.5, -0.5, SMOOTHING_ON);
4444
sprite[8] = rotozoomSurface(sprite[1], 0, 0.5, SMOOTHING_ON);

tests/sdl_rotozoom.png

274 KB
Loading

tests/test_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ def test_sdl_maprgba(self):
13891389

13901390
def test_sdl_rotozoom(self):
13911391
shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png'))
1392-
self.btest('sdl_rotozoom.c', reference='sdl_rotozoom.png', args=['--preload-file', 'screenshot.png'], reference_slack=5)
1392+
self.btest('sdl_rotozoom.c', reference='sdl_rotozoom.png', args=['--preload-file', 'screenshot.png'])
13931393

13941394
def test_sdl_gfx_primitives(self):
13951395
self.btest('sdl_gfx_primitives.c', reference='sdl_gfx_primitives.png', reference_slack=1)

0 commit comments

Comments
 (0)