From 41e121aec801c0ca276fa820393267f9191e4430 Mon Sep 17 00:00:00 2001 From: William Adams Date: Sat, 10 Nov 2012 14:15:07 -0800 Subject: [PATCH] modified: test_moveview.lua --- tests/test_moveview.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_moveview.lua b/tests/test_moveview.lua index 86beffe..534d252 100644 --- a/tests/test_moveview.lua +++ b/tests/test_moveview.lua @@ -22,7 +22,7 @@ Display:Snapshot(resource); local pixeldata, err = resource:ReadPixelData(); -local viewCount = 20 +local viewCount = 40 local views = {} for i=1,viewCount do @@ -34,24 +34,25 @@ for i=1,viewCount do x = x - displayWidth/2 if x < 0 then x = 0 - elseif x + displayWidth/2 > screenWidth-1 then + elseif x > screenWidth-1 - (displayWidth/2)+1 then x = screenWidth-1-displayWidth end y = y - displayHeight/2 if y < 0 then y = 0 - elseif y + displayHeight > screenHeight-1 then + elseif y > screenHeight-1 - (displayHeight/2)+1 then y = screenHeight-1-displayHeight end +print(string.format("[%d, %d]", x, y)); local view = Display:CreateView(displayWidth, displayHeight, x, y) view:CopyPixelBuffer(pixeldata); table.insert(views, view); -- Wait a bit - --ffi.C.sleep(1); + ffi.C.sleep(1); end ffi.C.sleep(3);