Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: select tool extension feature #46

Merged
merged 43 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2dedfcb
Change button direction name to direction
hunkim98 Jun 5, 2023
e2935e0
Create code for detecting selected area extend direction
hunkim98 Jun 9, 2023
eae1c7e
Fix rebase errors
hunkim98 Jun 22, 2023
cddd074
Allow select area edge mouse detection
hunkim98 Jun 22, 2023
77e350c
Change logic for detecting selecting area extend direction
hunkim98 Jun 29, 2023
a61208a
Change detectSelectedAreaExtendDirction logic
hunkim98 Jun 30, 2023
76296d1
Apply selectedarea change for top extension
hunkim98 Jun 30, 2023
acfd8a3
Fix stylemousecursor for select area
hunkim98 Jun 30, 2023
4417ac5
Add logic for changing selected area diagnoally
hunkim98 Jun 30, 2023
820c0a9
Change floor logic to round logic
hunkim98 Jun 30, 2023
bf25507
Create SelectArea type
hunkim98 Jun 30, 2023
5f7e9d7
Allow pixels to change for selected area top extend
hunkim98 Jul 1, 2023
1f46bf2
Fix sideways up pixel extend
hunkim98 Jul 1, 2023
10b6521
Filter pixels that go out of area
hunkim98 Jul 1, 2023
6c42368
Allow top extension to change data layer
hunkim98 Jul 2, 2023
0412668
Allow extension to happen sideways
hunkim98 Jul 3, 2023
2a7f33f
Change overlappingPixelIndices
hunkim98 Jul 3, 2023
001f4d4
Remove consoles for position utils
hunkim98 Jul 3, 2023
0dcc68b
Add onkeydown listener
hunkim98 Jul 4, 2023
392400d
add delete select area for key down
hunkim98 Jul 4, 2023
7f4b238
Allow select area to change when alt is pressed
hunkim98 Jul 4, 2023
661d982
Allow top bottom alt press extend possible
hunkim98 Jul 4, 2023
312ee7d
Allow alt to be pressed when area is already extending
hunkim98 Jul 5, 2023
6580dcf
Allow size extend for left and rigth with alt
hunkim98 Jul 5, 2023
b5560ac
Allow extension to happen diagonally
hunkim98 Jul 6, 2023
073398e
Add test for select area
hunkim98 Jul 7, 2023
ec08374
Add pre push to husky
hunkim98 Jul 7, 2023
2625e64
Change pre-commit to original
hunkim98 Jul 7, 2023
9737c19
Remove pre-push
hunkim98 Jul 7, 2023
058222f
Add test for extension to top
hunkim98 Jul 7, 2023
d1093ca
Allow alt press for extending to topleft and bottom right
hunkim98 Jul 7, 2023
8c6a74d
Refactor code for extension
hunkim98 Jul 7, 2023
4ff6110
Remove unnecessary originworldpos from extension logic
hunkim98 Jul 7, 2023
3b59870
Add test for sideway extension
hunkim98 Jul 7, 2023
0c79537
Add test for diagnoal extension
hunkim98 Jul 7, 2023
869cb6b
Finish code for testing select extension with alt
hunkim98 Jul 7, 2023
eb79f7b
Create extending selected area for extending logic
hunkim98 Jul 7, 2023
ab97c6b
Change offsetrowby and offsetcolumnby to round
hunkim98 Jul 7, 2023
0e0542d
Add test coverage for sonarcloud
hunkim98 Jul 8, 2023
48cf5b7
Allow alt press to change origin offset for extension
hunkim98 Jul 9, 2023
64f9c74
Apply comment reviews on editor and interaction layer
hunkim98 Jul 15, 2023
d01c92d
Remove console log escape
hunkim98 Jul 15, 2023
3d6044a
Add validation to getOverlappingPixelIndices function
hunkim98 Jul 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ jobs:
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0

- name: Install dependencies
run: yarn

- name: Test and coverage
run: yarn jest --coverage

- name: Analyze with SonarCloud
# You can pin the exact commit or the version.
# uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
Expand Down
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"build": "yarn clean && rollup -c",
"dev": "start-storybook -p 6005",
"storybook:build": "build-storybook",
"test": "jest",
"test": "jest -u",
"coverage": "jest -u --coverage",
"test:watch": "jest --watch",
"prepublishOnly": "yarn clean && yarn build",
"link-local": "yarn link && cd node_modules/react && yarn link && cd ../react-dom && yarn link",
Expand Down Expand Up @@ -84,5 +85,8 @@
"peerDependencies": {
"react": ">=17.2.0",
"react-dom": ">=17.2.0"
},
"dependencies": {
"@testing-library/user-event": "^14.4.3"
}
}
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ sonar.projectVersion=1.0
sonar.sources=src
sonar.tests=src
sonar.exclusions=node_modules/**
sonar.test.inclusions=**/*.test.ts, **/*.test.js, **/*.test.tsx, **/*.test.jsx
sonar.test.inclusions=src/**/*.test.ts, src/**/*.test.js, src/**/*.test.tsx, src/**/*.test.jsx
sonar.javascript.lcov.reportPaths=coverage/lcov.info
14 changes: 9 additions & 5 deletions src/actions/SelectAreaMoveAction.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { Action, ActionType } from "./Action";
import { BrushTool, ColorChangeItem } from "../components/Canvas/types";
import {
BrushTool,
ColorChangeItem,
SelectAreaRange,
} from "../components/Canvas/types";
import { Coord } from "../utils/types";

export class SelectAreaMoveAction extends Action {
type = ActionType.SelectAreaMove;
data: Array<ColorChangeItem>;
tool = BrushTool.SELECT;
previousSelectedArea: { startWorldPos: Coord; endWorldPos: Coord } | null;
newSelectedArea: { startWorldPos: Coord; endWorldPos: Coord } | null;
previousSelectedArea: SelectAreaRange | null;
newSelectedArea: SelectAreaRange | null;

constructor(
data: Array<ColorChangeItem>,
previousSelectedArea: { startWorldPos: Coord; endWorldPos: Coord } | null,
newSelectedArea: { startWorldPos: Coord; endWorldPos: Coord } | null,
previousSelectedArea: SelectAreaRange | null,
newSelectedArea: SelectAreaRange | null,
) {
super();
this.data = data;
Expand Down
Loading