03-03-2019 08:45
03-03-2019 08:45
<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>
03-12-2019 14:51
03-12-2019 14:51
I think there's 2mb of graphics memory, so you might be hitting some limit there.
What's the end result? Could you just change the image href instead of having multiple fullscreen svgs?
03-12-2019 15:09
03-12-2019 15:09
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.
03-13-2019 05:49
03-13-2019 05:49
The 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.