07-02-2022 11:05
07-02-2022 11:05
Want to create a setting to all me to change the width and height of a watchface line.
In Resource / Index.gui
<g id="mins" pointer-events="visible" transform="translate(50%,50%)">
<rect class="showMinutes" x="$-4" y="-145" width="8" height="150" fill="white"/>
</g>
In App index.js
let minHand = document.getElementById("mins");
If I hardcode
minHand.style.height = xxx(example 101)
or
minHand.style.width = xxx(example 10)
Nothing happens.. I can change the fill just fine.. Can these two be changed programmatically??
Thx
07-02-2022 14:00
07-02-2022 14:00
I think there's a couple of things going on there...
width and height are not properties of style, but of the rect element itself.
You want to change the width and height of the <rect>, and not those of the <g>, so your getElementById is getting the wrong element.