Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering canvas on windows causes visual glitch #22

Open
aki-cat opened this issue Dec 27, 2017 · 3 comments
Open

Rendering canvas on windows causes visual glitch #22

aki-cat opened this issue Dec 27, 2017 · 3 comments

Comments

@aki-cat
Copy link

aki-cat commented Dec 27, 2017

Ok, so I'm creating a database font editor, and I'm using a canvas to render the fonts using love's rendering functions because it's easier than figuring out how to use fonts with imgui (which is my bad).

But here's the thing: when the canvas makes the window become big enough to have a scrollbar, it causes this:
screen shot 2017-12-27 at 9 20 16 pm

But when you scroll down all the way, or when you set focus to other imgui windows, or even when a tooltip shows up, it goes back to what it's supposed to render:
screen shot 2017-12-27 at 9 20 21 pm

Note that the background also becomes white, when it was supposed to be gray. It looks like the canvas is not unsetting itself, maybe?

the code looks like this:

-- let's assume canvas is declared elsewhere
love.graphics.setCanvas(canvas)
love.graphics.setFont(font)
love.graphics.setColor(255, 255, 255)
love.graphics.printf(text, 0, 0, canvas_width)
love.graphics.setCanvas()
imgui.Image(canvas, canvas_width, canvas_height)

Since this is a problem with love2d's canvases, I assumed this would be an issue in the wrapper for love2d, and not necessarily imgui itself. There are many workarounds I can think of, but if there is an actual problem with the actual wrapper I thought it'd be better to address it. I hope it's ok to post this issue.

@slages
Copy link
Owner

slages commented May 11, 2018

I can't manage to reproduce it, if this problem is still relevant, can you provide me with a test code?

@sanikoyes
Copy link

just add love.graphics.setBlendMode('alpha', 'alphamultiply') to fix this problem

@aki-cat
Copy link
Author

aki-cat commented May 13, 2018

The problem seems to be fixed in the current master. It has been a while since I came back to that code, so I'm sorry for the delay in answering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants