Skip to content

Commit

Permalink
Resolve codacy remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaslehnertum committed Dec 7, 2023
1 parent 360ebae commit fa16e54
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/components/canvas/mouse-eventlistener.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ class MouseEventListenerComponent extends Component<Props, LocalState> {
pointerEvents={'none'}
style={{
position: 'fixed',
left: `${Math.min(this.state.selectionRectangle.startX!, this.state.selectionRectangle.endX!)}px`,
width: `${Math.abs(this.state.selectionRectangle.startX! - this.state.selectionRectangle.endX!)}px`,
top: `${Math.min(this.state.selectionRectangle.startY!, this.state.selectionRectangle.endY!)}px`,
height: `${Math.abs(this.state.selectionRectangle.startY! - this.state.selectionRectangle.endY!)}px`,
left: `${Math.min(this.state.selectionRectangle.startX ?? 0, this.state.selectionRectangle.endX ?? 0)}px`,
width: `${Math.abs(
(this.state.selectionRectangle.startX ?? 0) - (this.state.selectionRectangle.endX ?? 0),
)}px`,
top: `${Math.min(this.state.selectionRectangle.startY ?? 0, this.state.selectionRectangle.endY ?? 0)}px`,
height: `${Math.abs(
(this.state.selectionRectangle.startY ?? 0) - (this.state.selectionRectangle.endY ?? 0),
)}px`,
backgroundColor: '#1E90FF',
borderStyle: 'solid',
borderWidth: '1px',
Expand Down

0 comments on commit fa16e54

Please sign in to comment.