在拉斐尔防止规模

时间:2014-09-01 19:46:04

标签: javascript raphael scale

有一个小问题 - 需要有关如何在调整具有形状的纸张时防止缩放文本的帮助。

创建了拉斐尔论文:

...

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

...

使用以下方式完成缩放:

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);

...

形状和文字在同一张纸上,因此平移纸张会使文本也被缩放。有没有办法防止它?

1 个答案:

答案 0 :(得分:1)

完成,对于那些对它是如何实现感兴趣的人:

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