Pale
Member in Training
Posts: 24
|
Post by Pale on Apr 24, 2018 17:12:20 GMT
I have spent the last couple of days creating a database application with a bunch of display options including scaling the image on screen and come across a small issue. This could be me being stupid again, but the following could be a small bug.
scale = 0.5 graphicbox #level1.g, 5, 55, 500, 500 open "Level 1 display" for window as #level1 print #level1.g, "font Times_New_Roman 0 ";16*scale with scale set to 0.5 when you print any text it will be at 16 point not 8. If scale = 1 it is 16 point . if scale is 1.5 it will be 16 point. if scale is 2 it will be 32 point. Basically the multiplication does not work correct.
If i do the following
scale = 0.5 fontsize = 16*scale graphicbox #level1.g, 5, 55, 500, 500 open "Level 1 display" for window as #level1 print #level1.g, "font Times_New_Roman 0 ";fontsize All is well.
Hmm! The work around is easy but had me chasing my tail for a while.
Pale
|
|
|
Post by tsh73 on Apr 24, 2018 19:55:47 GMT
Interesting.
It looks if fontsize is not valid integer, it picks default size. (0 or 1.00001 or 16*0.5 or 32.00001 - anything makes 16)
So -it seems- if you just use INT you'll be saved?
But I would move it to Bugs board if there is one. EDIT: moved to Just BASIC Language Development \ Just BASIC v2
scale = 0.5 graphicbox #level1.g, 5, 55, 300, 300 open "Level 1 display" for window as #level1
#level1 "trapclose [quit]"
#level1.g "down; place 20 20" print #level1.g, "font Times_New_Roman 0 ";8'16*scale print "font Times_New_Roman 0 ";8'16*scale #level1.g "\Hello there 8"
#level1.g "down; place 20 50" print #level1.g, "font Times_New_Roman 0 ";16*scale print "font Times_New_Roman 0 ";16*scale #level1.g "\Hello there 16*scale"
#level1.g "down; place 20 150" print #level1.g, "font Times_New_Roman 0 ";int(16*scale) print "font Times_New_Roman 0 ";int(16*scale) #level1.g "\Hello there int"
#level1.g "down; place 20 200" print #level1.g, "font Times_New_Roman 0 ";32.0001 #level1.g "\Hello there WRONG HEIGHT"
#level1.g "flush"
wait
[quit] close #level1 end
|
|
Pale
Member in Training
Posts: 24
|
Post by Pale on Apr 25, 2018 16:45:36 GMT
Had it fail today and guessed it might be integer. I put INT on it and all was cured.
Even if the sum is whole it does not always work without INT. Number format I guess.
I cant find any reference to integer in the help file. Just one to remember I guess.
Thanks for your help
Pale
|
|