@@ -111,7 +111,7 @@ export class StillImageComponent implements OnChanges, OnDestroy {
111111
112112 @Output ( ) regionAdded = new EventEmitter < string > ( ) ;
113113
114- private _regionDrawMode : Boolean = false ; // stores whether viewer is currently drawing a region
114+ regionDrawMode : Boolean = false ; // stores whether viewer is currently drawing a region
115115 private _regionDragInfo ; // stores the information of the first click for drawing a region
116116 private _viewer : OpenSeadragon . Viewer ;
117117 private _regions : PolygonsForRegion = { } ;
@@ -201,7 +201,8 @@ export class StillImageComponent implements OnChanges, OnDestroy {
201201 * prevents navigation by mouse (so that the region can be accurately drawn).
202202 */
203203 drawButtonClicked ( ) : void {
204- this . _regionDrawMode = true ;
204+
205+ this . regionDrawMode = true ;
205206 this . _viewer . setMouseNavEnabled ( false ) ;
206207 }
207208
@@ -211,9 +212,9 @@ export class StillImageComponent implements OnChanges, OnDestroy {
211212 * @param endPoint the end point of the drawing
212213 * @param imageSize the image size for calculations
213214 */
214- private _openRegionDialog ( startPoint , endPoint , imageSize , overlay ) : void {
215+ private _openRegionDialog ( startPoint : Point2D , endPoint : Point2D , imageSize : Point2D , overlay : Element ) : void {
215216 const dialogConfig : MatDialogConfig = {
216- width : '840px ' ,
217+ width : '337px ' ,
217218 maxHeight : '80vh' ,
218219 position : {
219220 top : '112px'
@@ -243,7 +244,7 @@ export class StillImageComponent implements OnChanges, OnDestroy {
243244 * @param comment the value for the comment entered in the form
244245 * @param label the value for the label entered in the form
245246 */
246- private _uploadRegion ( startPoint , endPoint , imageSize , color , comment , label ) {
247+ private _uploadRegion ( startPoint : Point2D , endPoint : Point2D , imageSize : Point2D , color : string , comment : string , label : string ) {
247248 const x1 = Math . max ( Math . min ( startPoint . x , imageSize . x ) , 0 ) / imageSize . x ;
248249 const x2 = Math . max ( Math . min ( endPoint . x , imageSize . x ) , 0 ) / imageSize . x ;
249250 const y1 = Math . max ( Math . min ( startPoint . y , imageSize . y ) , 0 ) / imageSize . y ;
@@ -290,7 +291,7 @@ export class StillImageComponent implements OnChanges, OnDestroy {
290291 new OpenSeadragon . MouseTracker ( {
291292 element : this . _viewer . canvas ,
292293 pressHandler : ( event ) => {
293- if ( ! this . _regionDrawMode ) {
294+ if ( ! this . regionDrawMode ) {
294295 return ;
295296 }
296297 const overlayElement = document . createElement ( 'div' ) ;
@@ -320,13 +321,13 @@ export class StillImageComponent implements OnChanges, OnDestroy {
320321 this . _regionDragInfo . endPos = viewPortPos ;
321322 } ,
322323 releaseHandler : ( ) => {
323- if ( this . _regionDrawMode ) {
324+ if ( this . regionDrawMode ) {
324325 const imageSize = this . _viewer . world . getItemAt ( 0 ) . getContentSize ( ) ;
325326 const startPoint = this . _viewer . viewport . viewportToImageCoordinates ( this . _regionDragInfo . startPos ) ;
326327 const endPoint = this . _viewer . viewport . viewportToImageCoordinates ( this . _regionDragInfo . endPos ) ;
327328 this . _openRegionDialog ( startPoint , endPoint , imageSize , this . _regionDragInfo . overlayElement ) ;
328329 this . _regionDragInfo = null ;
329- this . _regionDrawMode = false ;
330+ this . regionDrawMode = false ;
330331 this . _viewer . setMouseNavEnabled ( true ) ;
331332 }
332333 }
0 commit comments