distorted graphics when using move or set loc
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
distorted graphics when using move or set loc
I asked a question to the forum a few years ago and never found a solution. I'm wondering if there's any new advice.. Basically, I'm moving a graphic from one side of the screen to another via a repeat loop until a stop command is issued to the repeat. If the graphic is moving very slowly it looks ok, but if I make it move fast then the graphic gets distorted. Basically, a round shape graphic turns into partially round shape with one side flattened out. Literally nothing I've tried fixes it.. some fixes tried unsucessfully:
- set acceleratedrendering to true
- set layermode of the graphic to dynamic
-tried using the set loc method vs the move method
- tried modifying the syncrate to no avail
- tried it on several different windows machines and the problem is somewhat consistent...some computers are worse than others.
- set acceleratedrendering to true
- set layermode of the graphic to dynamic
-tried using the set loc method vs the move method
- tried modifying the syncrate to no avail
- tried it on several different windows machines and the problem is somewhat consistent...some computers are worse than others.
-
- Livecode Opensource Backer
- Posts: 9386
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: distorted graphics when using move or set loc
It is not clear whether you are moving a GRAPHIC or an IMAGE,
and it is not clear HOW you are moving it.
If you could explain these that would make any attempt at answer rather easier.
and it is not clear HOW you are moving it.
If you could explain these that would make any attempt at answer rather easier.
-
- VIP Livecode Opensource Backer
- Posts: 9663
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: distorted graphics when using move or set loc
What Richmond said.
I assume you mean "graphic' when you say "graphic"
If I were much younger, and using 1980's-style thinking, I would try this in a button:
The circle moves smoothly without distortion.
So what Richmond means is, what are you doing?
Craig Newman
I assume you mean "graphic' when you say "graphic"
If I were much younger, and using 1980's-style thinking, I would try this in a button:
Code: Select all
on mouseUp
set the loc of grc 1 to "100,200"
repeat 200
set the loc of grc 1 to (item 1 of the loc of grc 1) + 1 & ",200"
wait 1
end repeat
end mouseUp
So what Richmond means is, what are you doing?
Craig Newman
Re: distorted graphics when using move or set loc
Sorry for the lack of details. I'm referring to grc or img objects. Both perform the same. I've also taken your script exactly as you wrote it, and placed within a new stack, and I get the same results. The edge of the graphic that is in the direction of the movement (ie the right side of the grc) flickers and distorts. I should also note, that this problem started around the days of Windows 8. I assume something changed in the MS environment that changed the way resources are utilized.
-
- Livecode Opensource Backer
- Posts: 9386
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: distorted graphics when using move or set loc
There seem to be a number of variables there apart from LiveCode itself:
Your computer's processor.
Your computer's graphic card.
How those interact with the version of Windows you have installed on your computer.
It might not be a bad idea to run the stack on a more up-to-date machine and see if
the same problem persists.
Your computer's processor.
Your computer's graphic card.
How those interact with the version of Windows you have installed on your computer.
It might not be a bad idea to run the stack on a more up-to-date machine and see if
the same problem persists.
-
- VIP Livecode Opensource Backer
- Posts: 9663
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: distorted graphics when using move or set loc
I am on a Mac. Ahem.I've also taken your script exactly as you wrote it, and placed within a new stack, and I get the same results.
Anyway, that little handler, with a simple circular grc, distorts along its path? What happens if you:
Code: Select all
on mouseUp
set the loc of grc 1 to "100,200"
repeat 100
lock screen
set the loc of grc 1 to (item 1 of the loc of grc 1) + 1 & ",200"
wait 1
unlock screen
end repeat
end mouseUp
Re: distorted graphics when using move or set loc
Craig. Thank you for your reply. Yes, it distorts along the path. No change with the lock/unlock commands. I should say, this is not just on my computer or environment. I've tested on numerous machines..some do it and some do not. Macs not as profound as PC's. The faster the movement, the more profound the distortion. I thought I read somewhere that Windows downgraded 2d graphics resources.. out of my pay grade.
-
- Livecode Opensource Backer
- Posts: 9386
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: distorted graphics when using move or set loc
Pretty clunky "over here" on 64-bit Linux (LC 9.0.1), and a sort of flashing effect at the leading edge.
-
- VIP Livecode Opensource Backer
- Posts: 9663
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: distorted graphics when using move or set loc
Using the "move" option (the one that should be used) I get a smooth motion.
Using the loop, I get a handful of successively faster "moves", until the overall speed stabilizes. If I change the handler at all, the process starts over.
Apparently, LC catches on to what I am up to, and grudgingly falls into line.
Craig
Using the loop, I get a handful of successively faster "moves", until the overall speed stabilizes. If I change the handler at all, the process starts over.
Apparently, LC catches on to what I am up to, and grudgingly falls into line.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: distorted graphics when using move or set loc
- On windows try
set the lowResolutionTimers to true - Also try in the line before "move"
lock messages - Draw a polygon instead of using a "regular" style of the graphic.
Regular polygons are clipped if the linesize increases.
(Bug reported long ago)
shiftLock happens
Re: distorted graphics when using move or set loc
Yep. That's what I see. Flashing effect on the leading edge is a better description than what I wrote. Setting the 'lowResolutionTimers to true' didn't change anything nor did the 'lock moves'richmond62 wrote: ↑Wed Dec 05, 2018 8:06 pmPretty clunky "over here" on 64-bit Linux (LC 9.0.1), and a sort of flashing effect at the leading edge.
distort.livecode.zip
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: distorted graphics when using move or set loc
I'd report this as a bug just to see if the team can fix it, but it sounds to me like the graphics card can't keep up with the required redraws. Since moving the control slower fixes the problem, that's probably the solution for now. Also, as suggested, you should be using the "move" command which is optimized for this. You can adjust the moveSpeed to find the speed that best eliminates the problem. Also do use acceleratedRendering and set the object's layermode to dynamic.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 365
- Joined: Mon Jun 10, 2013 1:32 pm
Re: distorted graphics when using move or set loc
Hi
I would suggest it's the driver. If it works on some machines and not others.
When you install windows on a machine that you do not have the latest graphic driver to it uses a "generic" vga Driver. If the OP has updated to Windows 10 from say a windows 7 machine then W10 will put in a generic driver.
In the Old days (sigh....) you could see a smallish window with just text inside distort when dragging never mind a graphic (although a window is a graphic -YKWIM)
Lagi
I would suggest it's the driver. If it works on some machines and not others.
When you install windows on a machine that you do not have the latest graphic driver to it uses a "generic" vga Driver. If the OP has updated to Windows 10 from say a windows 7 machine then W10 will put in a generic driver.
In the Old days (sigh....) you could see a smallish window with just text inside distort when dragging never mind a graphic (although a window is a graphic -YKWIM)
Lagi
Last edited by Lagi Pittas on Mon Dec 10, 2018 12:10 am, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: distorted graphics when using move or set loc
@Lagi, you're probably right, as a Mac user I never need to update drivers manually so I forget about those. But back in the Old Days, the first thing always suggested for graphic issues was to update the driver.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com