andr-ew / nest_

a language of touch for objects by monome [not maintained]
MIT License
21 stars 3 forks source link

txt module manual text box boundaries mixed axes #19

Closed andr-ew closed 3 years ago

andr-ew commented 3 years ago

see this example, should expect different widths on x-axis being manually set but instead they are auto-sized

n = nest_ {
    _txt.label {
        y = 4,
        x = {
            { { 4, 24 }, { 28, 48 }, { 52, 72 }, { 90, 126 } },
            { { 4, 24 }, { 28, 48 }, { 52, 72 }, { 80, 126 } },
            { { 4, 24 }, { 28, 48 }, { 52, 72 }, { 80, 126 } }
        },  
        value = {
            { 'foo', 'bar', 'ding', 'bat' },
            { 'bar', 'foo', 'bat', 'ding' },
            { 'bat', 'ding', 'bar', 'foo' }
        },
        border = 15,
        padding = 3,
        margin = 3,
        flow = 'y'
        --cellsize = { 10, 10 }
    }   
} :connect { key = key, enc = enc, screen = screen }

the issue is in txtpoint(), the "fixed" mode is not independent per-axis

local fixed = (d.x[2] ~= nil) and (d.y[2] ~= nil)

andr-ew commented 3 years ago

this is probably fixed now,,, but i am too lazy to test

andr-ew commented 3 years ago

coffee & fixed! 0d52eb0742396f5aed4a457b004178e27cbf8a2f