elm-graphics icon indicating copy to clipboard operation
elm-graphics copied to clipboard

Text rendering error in combination with `width`

Open pdamoc opened this issue 9 years ago • 4 comments

The following program:

import Element exposing (..)
import Text exposing (fromString)

main = 
  fromString "hello" |> centered 
  |> width 200
  |> toHtml

Gives the following error Uncaught TypeError: Cannot read property 'arity' of undefined

Commenting the width line gets rid of the error.

This error is present for Text Elements. If the Text Element is replaced by a collage, the presence of width does not produce the error anymore.

For example, this works:

import Element exposing (..)
import Collage exposing (..)
import Color exposing (..)

main = 
  collage 20 20 [rect 10 10 |> filled red]
  |> width 200
  |> toHtml

pdamoc avatar May 10 '16 09:05 pdamoc

👍 , ran into this myself, would like to see a fix. (I'd send a PR if history would lead me to believe that it would be merged in a timely fashion...)

mgold avatar May 15 '16 21:05 mgold

I ran into this issue myself as well.

lorenzo avatar May 16 '16 17:05 lorenzo

Ran into this too, but with height instead of width.

alphalambda avatar May 30 '16 12:05 alphalambda

When I used width 800 etc. nothing is rendered. Removing it solves the issue. Height etc. all working fine.

praveenksharma avatar Jul 27 '16 19:07 praveenksharma