import { ActionSerialized } from './ActionSerialized' ; import { Action } from './Action' ; import { Drawing } from './Drawing' ; description export class ActionClearZone extends Action { get xMax ( ) : number { return Math . max ( ... this . points . map ( ( p ) => p . x ) ) ; } serializeData ( ) { return { type : "clearzone" , pause : this . pause , userid : this . userid , points : this . points , cut : this . cut , removeContour : this . removeContour } ; } param userid param points param cut param removeContour constructor ( userid , private points , private cut , private removeContour ) { super ( userid ) ; } async redo ( ) { if ( this . removeContour ) Drawing . removeContour ( this . points ) ; if ( this . cut && this . removeContour ) Drawing . removeContour ( this . points ) ; if ( this . cut ) Drawing . clearPolygon ( this . points ) ; } createOverviewImage ( ) { return "url(img/icons/erase.svg)" ; } }