Resize icons on scale.
This commit is contained in:
@@ -31,9 +31,8 @@ web2d.Text = new Class({
|
||||
this._peer.setText(text);
|
||||
},
|
||||
|
||||
setTextAlignment : function(align)
|
||||
{
|
||||
$assert(align,"align can not be null");
|
||||
setTextAlignment : function(align) {
|
||||
$assert(align, "align can not be null");
|
||||
this._peer.setTextAlignment(align);
|
||||
},
|
||||
|
||||
@@ -87,5 +86,10 @@ web2d.Text = new Class({
|
||||
|
||||
getHeight : function() {
|
||||
return parseInt(this._peer.getHeight());
|
||||
},
|
||||
|
||||
getFontHeight : function() {
|
||||
var lines = this._peer.getText().split('\n').length;
|
||||
return Math.round(this.getHeight() / lines);
|
||||
}
|
||||
});
|
@@ -32,6 +32,10 @@ web2d.peer.svg.GroupPeer = new Class({
|
||||
var change = this._coordSize.width != width || this._coordSize.height != height;
|
||||
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");
|
||||
@@ -69,6 +73,21 @@ 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 + ")");
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user