Best way to draw lines on a card
Posted: Sat Jul 18, 2015 5:50 pm
I want to draw a box by drawing points, and I found a web site that suggested something like the following (under the upper button):
on mouseUp
choose brush tool
set the brush to 32
set the brushColor to brown
set the dragSpeed to 0
drag from 250,0 to 500,250 -- cuts off part at the right
drag from 0,250 to 250,0 --works
drag from 0,250 to 250,500 -- cuts off part at the bottom
drag from 250,500 to 500,250 -- shows nothing
-- draw tick marks to see how much is getting cut off
put 0 into K
repeat while K < 800
drag from 0,K to 10,K
put K+50 into K
end repeat
choose browse tool
end mouseUp
The result was a surprise - it clipped everything outside a magic boundary
It turns out that there's a magic clipping boundary from 0,0 to 399,399 and any would be drag fails (silently, I might add, no runtime errors) if outside this magic zone - I cannot find anything in a default stack that's that size, so what gives? It took me hours to discover this invisible limit.
Of course, what I really want is to make the graphic fit or exceed (and have optional scroll bars) the current screen size, or have a zoom function.
My question is how to draw a diamond and make it fit.
This stack had just two buttons (the lower button for "clear") and no other objects deliberately added.
on mouseUp
choose select tool
drag from 0,0 to 800,800 -- arbitrary number larger than the invisible drag limit frame
-- the inside 400x400 rectangle's outline flashes
cut
choose browse tool
end mouseUp
When the clear function runs, I can see it briefly select the 400x400 hidden rectangle and not an 800x800 one, so somewhere there's a hidden thing that I couldn't find.
There is no other code in the stack - this in a from-scratch new Mainstack.
When I rewrote the numbers to stay in the 400x400 rectangle, it looked fine.
on mouseUp
choose brush tool
set the brush to 32
set the brushColor to brown
set the dragSpeed to 0
drag from 250,0 to 500,250 -- cuts off part at the right
drag from 0,250 to 250,0 --works
drag from 0,250 to 250,500 -- cuts off part at the bottom
drag from 250,500 to 500,250 -- shows nothing
-- draw tick marks to see how much is getting cut off
put 0 into K
repeat while K < 800
drag from 0,K to 10,K
put K+50 into K
end repeat
choose browse tool
end mouseUp
The result was a surprise - it clipped everything outside a magic boundary
It turns out that there's a magic clipping boundary from 0,0 to 399,399 and any would be drag fails (silently, I might add, no runtime errors) if outside this magic zone - I cannot find anything in a default stack that's that size, so what gives? It took me hours to discover this invisible limit.
Of course, what I really want is to make the graphic fit or exceed (and have optional scroll bars) the current screen size, or have a zoom function.
My question is how to draw a diamond and make it fit.
This stack had just two buttons (the lower button for "clear") and no other objects deliberately added.
on mouseUp
choose select tool
drag from 0,0 to 800,800 -- arbitrary number larger than the invisible drag limit frame
-- the inside 400x400 rectangle's outline flashes
cut
choose browse tool
end mouseUp
When the clear function runs, I can see it briefly select the 400x400 hidden rectangle and not an 800x800 one, so somewhere there's a hidden thing that I couldn't find.
There is no other code in the stack - this in a from-scratch new Mainstack.
When I rewrote the numbers to stay in the 400x400 rectangle, it looked fine.