Skip to content

Commit

Permalink
remove outdated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Iefymchuk committed Nov 13, 2023
1 parent fa93143 commit 5a49855
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/engine/Graphics2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/ui/UiZoomTools.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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 });
Expand Down

0 comments on commit 5a49855

Please sign in to comment.