image element, minor

* image.toJson -> image.toJSON.
* remove unused 'fill' and 'operator' properties.
This commit is contained in:
abakkk 2020-09-22 18:22:41 +02:00
parent 27e194905b
commit 532b9242c9
3 changed files with 2 additions and 9 deletions

View File

@ -630,7 +630,6 @@ var DrawingArea = new Lang.Class({
color: this.currentColor, color: this.currentColor,
eraser: eraser, eraser: eraser,
image: this.currentImage, image: this.currentImage,
operator: this.currentOperator,
points: [] points: []
}); });
} else { } else {

View File

@ -767,19 +767,13 @@ const ImageElement = new Lang.Class({
Name: 'DrawOnYourScreenImageElement', Name: 'DrawOnYourScreenImageElement',
Extends: _DrawingElement, Extends: _DrawingElement,
_init: function(params) {
params.fill = false;
this.parent(params);
},
toJSON: function() { toJSON: function() {
return { return {
shape: this.shape, shape: this.shape,
color: this.color, color: this.color,
fill: this.fill,
eraser: this.eraser, eraser: this.eraser,
transformations: this.transformations, transformations: this.transformations,
image: this.image.toJson(), image: this.image,
preserveAspectRatio: this.preserveAspectRatio, preserveAspectRatio: this.preserveAspectRatio,
points: this.points.map((point) => [Math.round(point[0]*100)/100, Math.round(point[1]*100)/100]) points: this.points.map((point) => [Math.round(point[0]*100)/100, Math.round(point[1]*100)/100])
}; };

View File

@ -97,7 +97,7 @@ var Image = new Lang.Class({
return this.displayName; return this.displayName;
}, },
toJson: function() { toJSON: function() {
return { return {
displayName: this.displayName, displayName: this.displayName,
contentType: this.contentType, contentType: this.contentType,