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,
eraser: eraser,
image: this.currentImage,
operator: this.currentOperator,
points: []
});
} else {

View File

@ -767,19 +767,13 @@ const ImageElement = new Lang.Class({
Name: 'DrawOnYourScreenImageElement',
Extends: _DrawingElement,
_init: function(params) {
params.fill = false;
this.parent(params);
},
toJSON: function() {
return {
shape: this.shape,
color: this.color,
fill: this.fill,
eraser: this.eraser,
transformations: this.transformations,
image: this.image.toJson(),
image: this.image,
preserveAspectRatio: this.preserveAspectRatio,
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;
},
toJson: function() {
toJSON: function() {
return {
displayName: this.displayName,
contentType: this.contentType,