Pixel problem when moving drawings

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
IndieKid
Citizen
Posts: 80
Joined: Sat Dec 22, 2012 7:05 pm
Contact:

Pixel problem when moving drawings

Post by IndieKid »

Hey folks, this is a small graph app, you can drag graphs via left-button. When dragging something goes bad with pixels (look at the grid and graphs). I tried to set other Image Filter, but that doesn't seem to be helpful. Grid can be fixed with changing alpha(line 93) from 100 to 255, but I need that to be 100. Can you tell me how to fix that? Thanks!
Attachments
graph.love
(6.38 KiB) Downloaded 73 times
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Pixel problem when moving drawings

Post by Lafolie »

Are you drawing at non-integer co-ordinates when the mouse button is held?
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
IndieKid
Citizen
Posts: 80
Joined: Sat Dec 22, 2012 7:05 pm
Contact:

Re: Pixel problem when moving drawings

Post by IndieKid »

Lafolie wrote:Are you drawing at non-integer co-ordinates when the mouse button is held?
Nope.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Pixel problem when moving drawings

Post by davisdude »

If you don't know how to do that, just do something like this:

Code: Select all

love.graphics.draw( 'name', math.floor(name.x), math.floor(name.y))
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
IndieKid
Citizen
Posts: 80
Joined: Sat Dec 22, 2012 7:05 pm
Contact:

Re: Pixel problem when moving drawings

Post by IndieKid »

davisdude wrote:If you don't know how to do that, just do something like this:

Code: Select all

love.graphics.draw( 'name', math.floor(name.x), math.floor(name.y))
Tried before. No result.
User avatar
IndieKid
Citizen
Posts: 80
Joined: Sat Dec 22, 2012 7:05 pm
Contact:

Re: Pixel problem when moving drawings

Post by IndieKid »

It seems to be caused by

Code: Select all

boardField:clear()
timeField:clear()
--EDIT
Sure... But without this it will add drawings to canvas, but I need it just to update canvas.
If I put this code in love.update(), it will always draw those wrong pixels. Is there a way to call these functions only if there was something changed from the last tick?
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 153 guests