-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
refactor(Group): parent
+ fix(ActiveSelection): transferring object
#9349
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b3bc476
refactor(): `parent` + fix active selection edge case
ShaMan123 a09f840
update CHANGELOG.md
github-actions[bot] c2fc529
comments
ShaMan123 89e4c74
e2e test
ShaMan123 0b43b72
another parent/group fix
ShaMan123 d1f9b4d
Merge branch 'master' into parent
ShaMan123 d7fe84b
Merge branch 'master' into parent
ShaMan123 1395602
prettier
ShaMan123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,55 @@ | ||
import type { Page } from '@playwright/test'; | ||
import { expect, test } from '@playwright/test'; | ||
import setup from '../../../setup'; | ||
import { CanvasUtil } from '../../../utils/CanvasUtil'; | ||
|
||
setup(); | ||
|
||
test('selection stale state #9087', async ({ page }) => { | ||
await test.step('select', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.move(600, 600, { steps: 20 }); | ||
await page.mouse.up(); | ||
}); | ||
await test.step('rotate', async () => { | ||
await page.mouse.move(400, 150); | ||
await page.mouse.down(); | ||
await page.mouse.move(570, 150, { steps: 20 }); | ||
await page.mouse.up(); | ||
}); | ||
await test.step('deselect', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.up(); | ||
}); | ||
await test.step('select', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.move(600, 600, { steps: 20 }); | ||
await page.mouse.up(); | ||
const tests = [ | ||
{ | ||
name: 'selection stale state #9087', | ||
step: (page: Page) => | ||
test.step('deselect', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.up(); | ||
}), | ||
}, | ||
{ | ||
name: 'replacing selection', | ||
step: (page: Page) => | ||
test.step('replace selection', () => | ||
new CanvasUtil(page).executeInBrowser((canvas) => { | ||
canvas.setActiveObject( | ||
new fabric.ActiveSelection(canvas.getActiveObjects()) | ||
); | ||
})), | ||
}, | ||
]; | ||
|
||
for (const { name, step } of tests) { | ||
test(name, async ({ page }) => { | ||
await test.step('select', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.move(600, 600, { steps: 20 }); | ||
await page.mouse.up(); | ||
}); | ||
await test.step('rotate', async () => { | ||
await page.mouse.move(400, 150); | ||
await page.mouse.down(); | ||
await page.mouse.move(570, 150, { steps: 20 }); | ||
await page.mouse.up(); | ||
}); | ||
await step(page); | ||
await test.step('select', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.move(600, 600, { steps: 20 }); | ||
await page.mouse.up(); | ||
}); | ||
expect(await new CanvasUtil(page).screenshot()).toMatchSnapshot({ | ||
name: 'selection-stale-state.png', | ||
}); | ||
}); | ||
expect(await new CanvasUtil(page).screenshot()).toMatchSnapshot(); | ||
}); | ||
} |
Binary file removed
BIN
-12.5 KB
.../selection/stale-state/index.spec.ts-snapshots/selection-stale-state-9087-1.png
Binary file not shown.
Binary file added
BIN
+13.9 KB
e2e/tests/selection/stale-state/index.spec.ts-snapshots/selection-stale-state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is this fix to active selection