The below function includes the use of collage
, only to convert the
Shape/Form into an Element.
makeSlider : Element -> Form -> Element
makeSlider sliderShape sliderBarForm =
let
sliderBar =
--convert sliderBarForm from type Form to Element
collage 1000 1000 [(move (0,0) sliderBarForm)]
in
layers [sliderShape, sliderBar]
Is there a way to extract a Form's dimensions, like Graphics.Element.sizeOf
, so that the makeSlider
function does not need to know the explicit dimensions of sliderBarForm
?
Or does a toElement
function exist so that
collage 1000 1000 [(move (0,0) sliderBarForm)]
can be replaced with
toElement (move (0,0) sliderBarForm)
?