Skip to content

Commit

Permalink
Revert "#367 change selection of simple objects (#381)"
Browse files Browse the repository at this point in the history
This reverts commit 92c1da6.
  • Loading branch information
AndreiMazol authored Mar 15, 2021
1 parent c322a67 commit 5d3921d
Show file tree
Hide file tree
Showing 16 changed files with 536 additions and 532 deletions.
18 changes: 8 additions & 10 deletions packages/ketcher-react/src/script/editor/tool/helper/locate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2021 EPAM Systems
* Copyright 2020 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -71,11 +71,13 @@ function getElementsInRectangle(restruct, p0, p1) {
})

restruct.simpleObjects.forEach((item, id) => {
const referencePoints = item.getReferencePoints(true)
const referencePointInRectangle = referencePoints.find(
point => point.x > x0 && point.x < x1 && point.y > y0 && point.y < y1
if (
item.item.pos[0].x > x0 &&
item.item.pos[0].x < x1 &&
item.item.pos[0].y > y0 &&
item.item.pos[0].y < y1
)
if (referencePointInRectangle) simpleObjectsList.push(id)
simpleObjectsList.push(id)
})

const enhancedFlagList = []
Expand Down Expand Up @@ -142,11 +144,7 @@ function getElementsInPolygon(restruct, rr) {
})

restruct.simpleObjects.forEach((item, id) => {
const referencePoints = item.getReferencePoints(true)
const referencePointInPolygon = referencePoints.find(point =>
isPointInPolygon(r, point)
)
if (referencePointInPolygon) simpleObjectsList.push(id)
if (isPointInPolygon(r, item.item.pos[0])) simpleObjectsList.push(id)
})

const enhancedFlagList = []
Expand Down
76 changes: 0 additions & 76 deletions packages/ketcher-react/src/script/render/restruct/ReObject.ts

This file was deleted.

Loading

0 comments on commit 5d3921d

Please sign in to comment.