Skip to content

[Bug]: love.graphics.clear resets canvas position #276

Description

@Inkwalker

Software Version

3.0.3

What Happened?

love.graphics.clear after love.graphics.setCanvas(c) breaks canvas position in subsequent draw calls. It always renders at (0, 0) coordinates.
The bug only applies to canvases, images and primitives are not affected.

The canvas is supposed to be inside the yellow rectangle:

Image

What was Expected?

love.graphics.draw positions the canvas in correct coordinates

Code to Reproduce

function love.draw(screen)
    love.graphics.setCanvas(canvas)
    love.graphics.clear()

    love.graphics.setColor(1, 0, 0)
    love.graphics.rectangle("fill", 0, 0, 120, 60)
    love.graphics.setColor(0.5, 0, 0)
    love.graphics.line(0, 0, 120, 60)
    love.graphics.line(0, 60, 120, 0)

    love.graphics.setCanvas()

    love.graphics.setColor(1, 1, 1)
    love.graphics.draw(canvas, 50, 50, 0) --position is ignored

    love.graphics.setColor(1, 1, 0)
    love.graphics.rectangle("line", 50, 50, 120, 60)
end

Console

Nintendo 3DS

Firmware Version(s)

11.17.0-50U

Custom Firmware Version

Luma3DS v13.1.2

Execution Method

Homebrew Menu

Code of Conduct

  • I have read the Code of Conduct and agree to these terms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions