0x3C50 / Renderer

An easy to use rendering library for Minecraft mods using the Fabric toolchain
Other
185 stars 17 forks source link

Issue with two rounded rectangles #33

Closed Otter-Lover closed 1 year ago

Otter-Lover commented 1 year ago

Bug Description

I'm trying to create a some ui elements and I'm creating two boxes, though when I create the second box when I try to make it rounded it seems to go.. well all over the place (as seen in the screenshot below), It works perfectly fine if I don't try to round it (though ofc it won't be rounded).

I'm running 1.20.1 if that is needed info

Code

public void render(DrawContext context, int mousex, int mousey, float delta) {
        MatrixStack fs = context.getMatrices();
        fs.push();

        Renderer2d.renderRoundedQuad(fs, Color.BLACK, 15,15, 100, 30, 3, 5);
        Renderer2d.renderRoundedQuad(fs, Color.BLACK, 80,80, 150, 60, 3,5);

        font.drawString(fs, "Fun Text", 15, 15, 1f, 1f, 1f, 1f);
        font.drawString(fs, "Fun Text v3", 80, 60, 1f, 1f, 1f, 1f);

        fs.pop();
    }

Expected Behavior

The second box goes all over the place when rendering

Screenshots

image

Desktop

0x3C50 commented 1 year ago

your y end coordinate on the second box is lower than your y start. the start coordinates always need to be lower than the end coordinates

Otter-Lover commented 1 year ago

Ahh I didn't notice that, thanks!