britzl / defold-richtext

Defold-RichText is a system to create styled text based on an HTML inspired markup language
MIT License
75 stars 12 forks source link

<a=msg_id>link</a> scales too much with size tag when size ~= 1. #80

Closed Qwarr closed 1 year ago

Qwarr commented 1 year ago

To clarify the issue if size isn't 1 then the area to click is either way larger (>1) or way smaller (<1)

This code would work fine.

    local settings = {
        fonts = {
            pixel = {
                regular = hash("system_font"),
            },
        },
        size = 1,
        parent = gui.get_node("center"),
        position = vmath.vector3(0, 0, 0),
        align = richtext.ALIGN_CENTER,
        combine_words = true 
    }

But when size is <1 then the "hitbox" doesn't align with the text and is much smaller than expected.

    local settings = {
        fonts = {
            pixel = {
                regular = hash("system_font"),
            },
        },
        size = 0.5,
        parent = gui.get_node("center"),
        position = vmath.vector3(0, 0, 0),
        align = richtext.ALIGN_CENTER,
        combine_words = true 
    }