Skip to content Skip to sidebar Skip to footer

Html5 Canvas Drawimage() Not Working On Firefox

The problem: I'm working on a project where I need to animate the drawing of a symbol on a canvas. This is great and working on chrome, but on FireFox it doesn't draw anything. No

Solution 1:

Answer :

The problem indeed wasn't the drawImage() method. It was the way that I've written the svg.

Wrong:

<svgclass="svg x-color"xmlns="http://www.w3.org/2000/svg"viewBox="0 0 403.54 403.54"><defs><style>.shape{
                        fill: transparent;
                        stroke-dasharray: 570;
                        stroke-dashoffset: 570;
                    }
                </style></defs><lineid="s1"class="shape"x1="1.77"y1="1.77"x2="401.77"y2="401.77"/><lineid="s2"class="shape"x1="401.77"y1="1.77"x2="1.77"y2="401.77"/></svg>

Good:

<svgclass="svg x-color"xmlns="http://www.w3.org/2000/svg"width="403.54"height="403.54"version="1.1"><defs><style>.shape{
                        fill: transparent;
                        stroke-dasharray: 570;
                        stroke-dashoffset: 570;
                    }
                </style></defs><lineid="s1"class="shape"x1="1.77"y1="1.77"x2="401.77"y2="401.77"/><lineid="s2"class="shape"x1="401.77"y1="1.77"x2="1.77"y2="401.77"/></svg>

thanks to Helder Sepulveda

Post a Comment for "Html5 Canvas Drawimage() Not Working On Firefox"