fixing bugs
This commit is contained in:
@@ -36,7 +36,7 @@ web2d.peer.svg.ElementPeer.prototype.setChildren = function(children)
|
||||
web2d.peer.svg.ElementPeer.prototype.getChildren = function()
|
||||
{
|
||||
var result = this._children;
|
||||
if (!result)
|
||||
if (!core.Utils.isDefined(result))
|
||||
{
|
||||
result = [];
|
||||
this._children = result;
|
||||
@@ -270,7 +270,7 @@ web2d.peer.svg.ElementPeer.prototype.updateStrokeStyle = function()
|
||||
web2d.peer.svg.ElementPeer.prototype.attachChangeEventListener = function(type, listener)
|
||||
{
|
||||
var listeners = this.getChangeEventListeners(type);
|
||||
if (!listener)
|
||||
if (!core.Utils.isDefined(listener))
|
||||
{
|
||||
throw "Listener can not be null";
|
||||
}
|
||||
@@ -280,7 +280,7 @@ web2d.peer.svg.ElementPeer.prototype.attachChangeEventListener = function(type,
|
||||
web2d.peer.svg.ElementPeer.prototype.getChangeEventListeners = function(type)
|
||||
{
|
||||
var listeners = this._changeListeners[type];
|
||||
if (!listeners)
|
||||
if (!core.Utils.isDefined(listeners))
|
||||
{
|
||||
listeners = [];
|
||||
this._changeListeners[type] = listeners;
|
||||
|
@@ -53,7 +53,7 @@ web2d.peer.svg.RectPeer.prototype.setSize = function(width, height)
|
||||
web2d.peer.svg.RectPeer.superClass.setSize.call(this, width, height);
|
||||
|
||||
var min = width < height?width:height;
|
||||
if (this._arc)
|
||||
if (core.Utils.isDefined(this._arc))
|
||||
{
|
||||
// Transform percentages to SVG format.
|
||||
var arc = (min / 2) * this._arc;
|
||||
|
@@ -45,7 +45,7 @@ web2d.peer.svg.TextPeer.prototype.setText = function(text)
|
||||
{
|
||||
text = core.Utils.escapeInvalidTags(text);
|
||||
var child = this._native.firstChild;
|
||||
if (child)
|
||||
if (core.Utils.isDefined(child))
|
||||
{
|
||||
this._native.removeChild(child);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ web2d.peer.svg.TextPeer.prototype.setPosition = function(x, y)
|
||||
{
|
||||
this._position = {x:x, y:y};
|
||||
var height = this._font.getSize();
|
||||
if(this._parent && this._native.getBBox)
|
||||
if(core.Utils.isDefined(this._parent) && core.Utils.isDefined(this._native.getBBox))
|
||||
height = this.getHeight();
|
||||
var size = parseInt(height);
|
||||
this._native.setAttribute('y', y+size*3/4);
|
||||
|
Reference in New Issue
Block a user