FBA The Creator

The True Multiplatform PC / PocketPC Opensource Development Tool - Read Only Mode - Kept only for historical purposes - Thank you all ;)
It is currently Thu Jun 04, 2026 3:50 am

All times are UTC




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Mar 15, 2009 8:06 am 
Offline

Joined: Mon Feb 09, 2009 6:56 pm
Posts: 14
I think I just found a bug in the rect (x1,y1,x2,y2,r,g,b) function.
It only happens when you set the resolution to be 480x640 and draw a rectangle with the y2 coordinate beyond the bounds of the screen.

I've replicated this using the HelloWorld sample code listed here:
Code:
--------------------------------------------------- 
-- FBA Tutorials
--
-- Tutorial / 01 / HelloWorld
--
---------------------------------------------------
--
-- The simplest FBA script, the "HelloWorld" !
--
-- This example shows minimal code required in order to create
-- the main window
---------------------------------------------------

debug("Hello World!")


function onmainloop()   
         --
         -- this routine is called on each frame by FBA. You have
         -- to draw all your cool graphics here...
         --
         fillrect (10,10, screenwidth()-10, screenheight()+10, 100,100,100)
         
         rect (10, 10, screenwidth()-10, screenheight() + 10, 255,255,255)
         
         
         
         -- quit if we're pressing stylus/mouse
         if (mousedown() > 0) then
            quit()
         end
end

-- this is an optional event automatically called when your application
-- is about to be closed. You can do here some finalization code (settings save etc)
-- or just ignore it if you don't need it ;)
--
-- don't draw anything here, because after this function your application will be closed ;)
--
function onquit()

end


Basically, if you run this in any resolution other than 480x640, it will work.

The line is question is:
rect (10, 10, screenwidth()-10, screenheight() + 10, 255,255,255)

I've tried several scenarios:
rect (10, 10, screenwidth()-10, screenheight() + 10, 255,255,255) <- crashes
rect (10, 10, screenwidth()-10, screenheight(), 255,255,255) <- crashes
rect (10, 10, screenwidth()-10, screenheight() - 1, 255,255,255) <- does not crash
rect (10, 10, screenwidth()+10, screenheight() - 1, 255,255,255) <- does not crash


If you comment out the rect line, and just do the fillrect (which fills in the same area) it will work.

I'm currently doing a scrolling list which can have up to 100 items. So the ability to draw rects outside of the screen area is important.

Thanks.


Top
   
PostPosted: Tue Apr 07, 2009 6:20 pm 
Offline

Joined: Mon Feb 09, 2009 6:56 pm
Posts: 14
Is this being investigated?

Thanks.


Top
   
PostPosted: Tue Apr 07, 2009 8:32 pm 
Offline
FBA Administrator
FBA Administrator
User avatar

Joined: Fri Mar 21, 2008 11:19 pm
Posts: 238
Location: Rome - Italy
Try to set clipping before your drawing operations:

clipping(0,0,screenwidth()-1,screenheight()-1)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited