JuliaGizmos / Escher.jl

Composable Web UIs in Julia
https://juliagizmos.github.io/Escher.jl
Other
337 stars 63 forks source link

hbox not working properly #122

Closed omalled closed 8 years ago

omalled commented 8 years ago

The following code uses hbox, but the browser displays it as if I had used vbox:

function main(window)
    hbox(plaintext("foo"), plaintext("bar"))
end

That is, the browser displays something like

foo bar

with "foo" above "bar" rather than something like

foobar

with "foo" to the left of "bar". I am using julia 0.4.3 and Escher 0.3.1 on a Mac and I tried viewing in both Firefox and an up-to-date Chrome.

randyzwitch commented 8 years ago

Confirmed. Seems like it's a problem with plaintext; doing a similar example from the documentation works:

function main(window)
    push!(window.assets, "tex")

    txt = tex("T = 2\\pi\\sqrt{L\\over g}")
    txt1 = fontcolor("#499", txt)
    txt2 = fontcolor("#499", txt)
    txt3 = fillcolor("#eeb", txt2)

    hbox(txt, txt1, txt2, txt3)
end
screen shot 2016-04-12 at 4 52 54 pm
rohitvarkey commented 8 years ago

Interestingly, hbox(hbox(plaintext("foo"), plaintext("bar"))) works.

When hbox is used at the top the div doesn't seem to get the flow horizontal class added to it. I'll take a look at this tomorrow.

shashi commented 8 years ago

The problem is patching the initial div that exists before rendering anything is not quite working. So if you put your whole app in a container (pad(0em) e.g.) it should look like it should. I'm trying to figure out what's up.

shashi commented 8 years ago

Okay traced this back to https://github.com/shashi/Patchwork.jl/commit/6cc99119024ef64459076bf6b41e482931391832

I accidentally reversed some changes while building the Patchwork build.js file. (I will need to fork virtual-dom to prevent this.)