Multiline working :)

This commit is contained in:
Paulo Veiga
2011-09-04 03:28:09 -03:00
parent b1b0ee0de8
commit cc9bf1b908
6 changed files with 87 additions and 128 deletions

View File

@@ -33,9 +33,6 @@ web2d.peer.svg.GroupPeer = new Class({
this._coordSize.width = width;
this._coordSize.height = height;
console.log("coordSize.width:" + width);
console.log("coordSize.height:" + height);
if (change)
this.updateTransform();
web2d.peer.utils.EventUtils.broadcastChangeEvent(this, "strokeStyle");
@@ -73,21 +70,6 @@ web2d.peer.svg.GroupPeer = new Class({
var cx = this._position.x - this._coordOrigin.x * sx;
var cy = this._position.y - this._coordOrigin.y * sy;
console.log("------------------");
console.log("this._coordSize.width:" + this._coordSize.width);
console.log("this._coordSize.height:" + this._coordSize.height);
console.log("cx:" + cx);
console.log("cy:" + cy);
console.log("this._size.width:" + this._size.width);
console.log("this._size.height:" + this._size.height);
console.log("sx:" + sx);
console.log("sy:" + sy);
console.log("------------------");
this._native.setAttribute("transform", "translate(" + cx + "," + cy + ") scale(" + sx + "," + sy + ")");
},

View File

@@ -55,7 +55,7 @@ web2d.peer.svg.TextPeer = new Class({
var tspan = window.document.createElementNS(this.svgNamespace, 'tspan');
tspan.setAttribute('dy', '1em');
tspan.setAttribute('x', this.getPosition().x);
var tspanContent = window.document.createTextNode(line);
var tspanContent = window.document.createTextNode(line.length == 0 ? " " : line);
tspan.appendChild(tspanContent);
tspans.push(tspan);
@@ -107,11 +107,8 @@ web2d.peer.svg.TextPeer = new Class({
this._native.setAttribute('font-size', this._font.getGraphSize());
this._native.setAttribute('font-style', this._font.getStyle());
this._native.setAttribute('font-weight', this._font.getWeight());
var scale = this._font.getFontScale();
this._native.xFontScale = scale.toFixed(1);
},
setColor : function(color) {
this._native.setAttribute('fill', color);
},