From 5a49855ba7d32b5889be71c61e66f5476f2f4584 Mon Sep 17 00:00:00 2001 From: Oleksandr Iefymchuk Date: Mon, 13 Nov 2023 18:13:52 +0200 Subject: [PATCH] remove outdated code --- src/engine/Graphics2d.js | 4 ---- src/ui/UiZoomTools.jsx | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/engine/Graphics2d.js b/src/engine/Graphics2d.js index 02af9976..ae7d04b6 100644 --- a/src/engine/Graphics2d.js +++ b/src/engine/Graphics2d.js @@ -484,10 +484,6 @@ class Graphics2d extends React.Component { const h = this.m_toolPick.m_hScreen; this.segm2d.render(ctx, w, h, this.imgData); } else { - // ctx.imageSmoothingEnabled = true; - - // ctx.putImageData(this.imgData, 0, 0); - // ctx.drawImage(objCanvas, xPos, yPos, canvasWidth, canvasHeight, 0, 0, newImgWidth, newImgHeight); createImageBitmap(this.imgData) .then((imageBitmap) => { ctx.drawImage(imageBitmap, xPos, yPos, canvasWidth, canvasHeight, 0, 0, newImgWidth, newImgHeight); diff --git a/src/ui/UiZoomTools.jsx b/src/ui/UiZoomTools.jsx index c65a5d60..e9be4ffe 100644 --- a/src/ui/UiZoomTools.jsx +++ b/src/ui/UiZoomTools.jsx @@ -12,6 +12,7 @@ import { buttonsBuilder } from './Button/Button'; import { Container } from './Layout/Container'; const UiZoomTools = (props) => { + const MIN_ZOOM_THRESHOLD = 0.8; const [activeButton, setActiveButton] = useState(Tools2dType.NONE); const zoomImage = (step, buttonId) => { @@ -55,7 +56,7 @@ const UiZoomTools = (props) => { setActiveButton(buttonId); props.dispatch({ type: StoreActionType.SET_2D_TOOLS_INDEX, indexTools2d: buttonId }); - if (buttonId === Tools2dType.ZOOM_100 || (buttonId === Tools2dType.ZOOM_OUT && props.render2dZoom > 0.8)) { + if (buttonId === Tools2dType.ZOOM_100 || (buttonId === Tools2dType.ZOOM_OUT && props.render2dZoom > MIN_ZOOM_THRESHOLD)) { props.dispatch({ type: StoreActionType.SET_2D_ZOOM, render2dZoom: 1.0 }); props.dispatch({ type: StoreActionType.SET_2D_X_POS, render2dxPos: 0.0 }); props.dispatch({ type: StoreActionType.SET_2D_Y_POS, render2dyPos: 0.0 });