Rotating Widgets Resizing

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Rotating Widgets Resizing

Post by richmond62 »

ss1.png
ss2.png
-
This is a right pox. The "beetle" (SVG widget) should NOT resize when rotated.

Oh, and before you ask; the widget is not locked.
Attachments
Robot.livecode.zip
Here's the stack.
(14.58 KiB) Downloaded 222 times
Last edited by richmond62 on Mon Apr 22, 2019 9:06 pm, edited 1 time in total.
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Rotating Widgets Resizing

Post by bogs »

I'm curious why you think it would not resize as any graphic would? Being an svg graphic isn't going to change that behavior.
Image
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Rotating Widgets Resizing

Post by richmond62 »

Because if one rotates a bitmap (apart from the fact that it goes "all hairy round the edges")
it does not resize.
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Rotating Widgets Resizing

Post by bogs »

Maybe you should enable the border on the bmp image, and check again.
Hmmm....?
Hmmm....?
Image
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Rotating Widgets Resizing

Post by richmond62 »

BEETLES.png
-
Here's a sort of comparison stack.

The beetle on the left is an SVG Widget.

The beetle in the middle is a PNG image.

The beetle on the right is not a beetle at all, it is a rectangular graphic
and the 8 buttons change its backGroundPattern.

Note the hairy legs on the central beetle.
Attachments
Robot.livecode.zip
Here's the stack.
(96.38 KiB) Downloaded 217 times
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Rotating Widgets Resizing

Post by bogs »

Too new for me to run apparently (went as far up the chain as 8.x).

When I suggested turning on the borders before rotating a bmp, it was because I had done just that, the bmp resizes just the same as any other graphic I've seen, so I still don't know why you would not expect that from the svg.
Image
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Rotating Widgets Resizing

Post by richmond62 »

Too new for me to run apparently
Just for you, darling . . .
-
Robot8.livecode.zip
Here's the stack saved in LC 8 format
(96.45 KiB) Downloaded 218 times
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Rotating Widgets Resizing

Post by bogs »

Thanks, it did allow me to experiment some. I put a border around the image (middle one), and started turning it and, as expected, it resizes.
Bigger...
Bigger...
Selection_001.png (17.87 KiB) Viewed 5681 times
Smaller...
Smaller...
Selection_002.png (17.47 KiB) Viewed 5681 times
The only difference is on how they resize, the svg resizes towards the center, where as the image file resized the edges. I'm not positive how background images resize, but I am pretty sure they do, probably outward as the image does.
Image
[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Rotating Widgets Resizing

Post by [-hh] »

To summarize several threads about rotating the SVG widget.

The widget does NEVER resize if you change the angle of the widget. This is NOT implemented.

You can see this by looking at the LCB code or, simpler, by changing the angle from the property inspector in pointer mode.

But if you have the boundingBox of the SVG path you can compute the widget size needed for a certain rotation of the path.
shiftLock happens
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Rotating Widgets Resizing

Post by richmond62 »

But if you have the boundingBox of the SVG path you can compute the widget size needed for a certain rotation of the path.
Indeed: some spotty little 9 year old suggested that yesterday
when he was meant to be concentrating on a grammar test!

I cancelled the test (to everyone's relief), handed out some sweeties, and set them working on
it. 8)
Post Reply