Search code examples
javascriptraphaelscale

prevent scale in Raphael


Have a small issue - need help on how to prevent zooming text during resizing paper with the shapes.

Have a Raphael paper created:

...

this._paper = Raphael(this._inner[0],this._inner.width(),this._inner.height());
this._set = this._paper.set();     

...

and scaling done using:

zoomIn: function(event, useCoords) {
        this.zoomTo(this._zoom * this.options.zoomStep, event, useCoords);

    },
    zoomOut: function(event, useCoords) {
        this.zoomTo(this._zoom / this.options.zoomStep, event, useCoords);
    },

...

this._paper.setSize(w, h);
this._paper.setViewBox(0, 0, this._mapWidth, this._mapHeight, false);

...

The shapes and texts are on the same paper so panning the paper makes the texts are scalled as well. Is there a way on how to prevent it?


Solution

  • Done, for ones who are interested on how it's been achieved:

    <http://jsfiddle.net/0ky5avg3>