Recent

Author Topic: Graphical glitch  (Read 440 times)

BubikolRamios

  • Sr. Member
  • ****
  • Posts: 299
Graphical glitch
« on: August 04, 2024, 10:37:08 am »
The list on top of tPanel, contains data for drawing various shapes . The effect seen at attached image does not apply for all shapes just for some.

Point: something sometimes appears only as consequence of tPanel being there(visible/not visible). Extra thing is fixed per single data, not randome.

Not the end of the world, just interesting. Any clue ?

« Last Edit: August 04, 2024, 10:46:10 am by BubikolRamios »
lazarus 3.2-fpc-3.2.2-win32/win64

Eugene Loza

  • Hero Member
  • *****
  • Posts: 729
    • My games in Pascal
Re: Graphical glitch
« Reply #1 on: August 04, 2024, 10:54:06 am »
Means something is drawn on TPanel or its children, instead of on your primary TCanvas. This is definitely possible, but I'm not sure how easy is to make such a mistake accidentally. I guess you can try searching for all LineTo in the code and make sure they are all called on a proper parent. Note that overusing with may bite you back now as it may obscure the namespace you are using and you might want to Source -> Refactoring -> Explode a "With" block at least temporarily.

You can also go backwards and try to pinpoint which exactly command (line of your list) results in such behavior. Then try to follow the logic of what is happening when executing this command and how it is different from others.
My FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

alpine

  • Hero Member
  • *****
  • Posts: 1263
Re: Graphical glitch
« Reply #2 on: August 04, 2024, 11:23:34 am »
The list on top of tPanel, contains data for drawing various shapes . The effect seen at attached image does not apply for all shapes just for some.

Point: something sometimes appears only as consequence of tPanel being there(visible/not visible). Extra thing is fixed per single data, not randome.

Not the end of the world, just interesting. Any clue ?
Very interesting. It seems the artifacts are the rightmost lines from the original shape but with erroneous coordinates. But I don't think I'll guess something more without the source.
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

jamie

  • Hero Member
  • *****
  • Posts: 6550
Re: Graphical glitch
« Reply #3 on: August 04, 2024, 03:29:11 pm »
If you are calling other GUI items while in the loop of drawing those lines, its possible the canvas is getting changed and it would be an idea to use the Save and Restore handle between the calls, even the LOCK may work,.
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018