<symbol id="tile" pointer-events="visible">
<mask id="mask">
<rect id="cut" width="75" height="75" class="borderCorners" />
</mask>
<svg id="back" mask="#mask" width="300" height="300">
<image href="images/4.png" pointer-events="none" />
</svg>
</symbol>
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
The idea is to let user upload their own full screen image and then using mask split it into tiles for slide puzzle. So I need multiple references to the same image and different mask position.
I finally made it work on the device. I also thought I was hitting memory limits - due to real image/svg dimensions. So I made symbol 3 times smaller and then scale it to full size via group transform (I also ditched the SVG, realizing I can mask symbol itself):
<mask id="mask">
<rect width="25" height="25" class="borderCorners" />
</mask>
<symbol id="tile" pointer-events="visible" mask="#mask" width="100" height="100" >
<image id="back" href="images/4.png" pointer-events="none"/>
</symbol><g transform="scale(3)"> <use href="#tile" id="0_0" /><use href="#tile" id="0_1" />
<use href="#tile" id="0_2" />... </g>
And I can't tell a difference from the original image.
Best AnswerThe only problem with this approach - I have a "onmousedown" event attached to these "use" tile elements that move a tile on tap (changes x or y coordinate). It works fine, but every now and then there's a "hiccup" - 2-3 seconds delay between tap and move. Strange thing is - if I don't assign "layer" property of these tiles (to any value, really) - tap doesn't work at all.
Best Answer