Wykres commitów

1861 Commity (mitja/improve-current-page-shapes-sorted)

Autor SHA1 Wiadomość Data
Mitja Bezenšek 07388090fb Add a filter. 2024-04-11 18:00:21 +02:00
Mitja Bezenšek bc9087f9d6 Improve perf. 2024-04-11 17:02:39 +02:00
Mitja Bezenšek 6405040d7f Undo sort, seems it broke a bunch of tests. 2024-04-11 16:33:18 +02:00
Mitja Bezenšek 84b7cdef9c Sort when setting. 2024-04-11 16:26:49 +02:00
Mitja Bezenšek fc6197aab4 Refactor. 2024-04-11 16:23:34 +02:00
Mitja Bezenšek 9c8a201777 Refactor. 2024-04-11 16:18:42 +02:00
Mitja Bezenšek 4e1146f602 Simplfiy. 2024-04-11 16:16:10 +02:00
Mitja Bezenšek bacd1d0605 Docs 2024-04-11 16:08:47 +02:00
Mitja Bezenšek 58ca72d409 We now sort he selected ids. 2024-04-11 16:07:34 +02:00
Mitja Bezenšek 32cd25bef6 Add docs. 2024-04-11 15:52:49 +02:00
Mitja Bezenšek 5ee30d5b66 Fix perf for brushing. 2024-04-11 15:40:09 +02:00
Mitja Bezenšek b330d86cd7 Rename 2024-04-11 13:55:45 +02:00
Mitja Bezenšek ec888b4560 Fix tests and improve perf. 2024-04-11 13:38:11 +02:00
Mitja Bezenšek 3ca546ac89 WIP 2024-04-11 12:49:10 +02:00
Mitja Bezenšek 848c4d327e Scrible brushing. 2024-04-11 12:49:10 +02:00
Mitja Bezenšek 55c9a3692b Brushing. 2024-04-11 12:49:10 +02:00
Mitja Bezenšek 7531565d88 Erasing. 2024-04-11 12:49:10 +02:00
Mitja Bezenšek 54432b3bd9 Api. 2024-04-11 12:49:10 +02:00
Mitja Bezenšek eccf9a392b Revert hit testing. 2024-04-11 12:49:10 +02:00
Mitja Bezenšek 43a196973b Simplify. 2024-04-11 12:49:10 +02:00
Mitja Bezenšek a6c25167cb Improve shapes at point. 2024-04-11 12:49:10 +02:00
Mitja Bezenšek 442a6aef18 Remove previous logic. 2024-04-11 12:49:10 +02:00
Mitja Bezenšek 5b5dd614f1 Fix brushing. 2024-04-11 12:49:10 +02:00
Mitja Bezenšek d8bd162aca Merge branch 'main' into mitja/rbush-again 2024-04-11 12:49:10 +02:00
Mitja Bezenšek 3328625a38 Add some more apis. 2024-04-10 17:29:46 +02:00
Mitja Bezenšek 56859f9e22 Delete logs. 2024-04-10 17:17:49 +02:00
Mitja Bezenšek ca73b7afc1 Extract to class. 2024-04-10 17:13:33 +02:00
Mitja Bezenšek d00a0a6f33 Initial version 2024-04-10 16:24:48 +02:00
Steve Ruiz b3a1db90ec
Remove minimap throttling (#3438)
Our throttling isn't right for the minimap. Yanking this back.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `bugfix` — Bug fix
2024-04-10 14:12:08 +00:00
Steve Ruiz 2cc8f44f83
Make minimap display sharp rectangles. (#3434)
The minimap now uses faster sharp rectangles for shapes.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features

### Release Notes

- Improve
2024-04-10 12:53:11 +00:00
Mitja Bezenšek de951dee59
Reorder dom elements. (#3431)
We reorded the dom a bit when we added the web gl rendered culled
shapes. We can now revert that.

Also noticed we weren't positioning the wrapper, so the z-index didn't
not apply.

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [x] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [x] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2024-04-10 12:03:09 +00:00
Steve Ruiz 180cb67250
Improve hand dragging with long press (#3432)
This PR makes a small improvement to the hand tool to address a "long
press"-related issues.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `bugfix` — Bug fix
2024-04-10 12:02:50 +00:00
Mitja Bezenšek 987b1ac0b9
Perf: Incremental culled shapes calculation. (#3411)
Reworks our culling logic:
- No longer show the gray rectangles for culled shapes. 
- Don't use `renderingBoundExpanded`, instead we now use
`viewportPageBounds`. I've removed `renderingBoundsExpanded`, but we
might want to deprecate it?
- There's now a incremental computation of non visible shapes, which are
shapes outside of `viewportPageBounds` and shapes that outside of their
parents' clipping bounds.
- There's also a new `getCulledShapes` function in `Editor`, which uses
the non visible shapes computation as a part of the culled shape
computation.
- Also moved some of the `getRenderingShapes` tests to newly created
`getCullingShapes` tests.

Feels much better on my old, 2017 ipad (first tab is this PR, second is
current prod, third is staging).


https://github.com/tldraw/tldraw/assets/2523721/327a7313-9273-4350-89a0-617a30fc01a2

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [x] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know


### Test Plan

1. Regular culling shapes tests. Pan / zoom around. Use minimap. Change
pages.

- [x] Unit Tests
- [ ] End to end tests

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2024-04-10 10:29:11 +00:00
Steve Ruiz 2bbab1a790
Perf: Improve text outline performance (#3429)
We use text shadows to create "outlines" around text shapes. These
shadows are rendered on the GPU. In Chrome (and on computers with a
capable GPU) text shadows work pretty well, however on Safari—and in
particular on iOS—they cause massive frame drops.


https://github.com/tldraw/tldraw/assets/23072548/b65cbcaa-6cc3-46f3-b54d-1f9cc07fc499

This PR:
- adds an LOD to text shadows, removing them at < 35% zoom
- removes text shadows entirely on Safari

If we had a "high performance" or "low-end device" mode, then shadows /
text shadows would be the first to go.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features

### Test Plan

1. Use text shapes on iOS.
2. Use text shapes on Safari.
3. Use text shapes on Chrome.

### Release Notes

- Improves performance of text shapes on iOS / Safari.
2024-04-10 10:20:16 +00:00
Mitja Bezenšek b601e701b2 Update for rebase from main. 2024-04-10 11:51:03 +02:00
Mitja Bezenšek 9b6beb5fd5 Safari fix? 2024-04-10 11:49:25 +02:00
Mitja Bezenšek 9232f661c4 Typo. 2024-04-10 11:49:25 +02:00
Mitja Bezenšek e6c42c619a Add some fuzz tests. 2024-04-10 11:49:25 +02:00
Mitja Bezenšek fac342f54b Don't need to return. 2024-04-10 11:49:25 +02:00
Mitja Bezenšek fdbc5410f4 Simplify. 2024-04-10 11:49:25 +02:00
Steve Ruiz 12a6eed12f ok 2024-04-10 11:49:25 +02:00
Steve Ruiz 22325d1de4 Merge branch 'main' into mitja/incremental 2024-04-10 11:49:03 +02:00
Steve Ruiz 6305e83830
Fix some tests (#3403)
This PR fixes some jest test.

- We skip the culling shapes in test environments.
- We skip rendering patterns in test environments.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `tests` — Changes to any test code
2024-04-09 15:42:54 +00:00
Steve Ruiz 3b98e36914
Perf: throttle `updateHoveredId` (#3419)
This PR throttles the `updateHoveredId` call so that it happens ever
30ms.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features

### Release Notes

- Improves canvas performance by throttling the update to the editor's
hovered id.
2024-04-09 15:33:07 +00:00
Steve Ruiz 988dbbde28
Fix text bug on iOS (#3423)
In this PR, we no longer buffer pointer down/ups. We now batch only
`pointer_move`, `wheel`, and `pinch` events.

Batched inputs were causing text not to work on iOS. On iOS, the
keyboard is only shown if we call `focus` during the same event loop as
a user input.

### Change Type
- [x] `sdk` — Changes the tldraw SDK
- [x] `bugfix` — Bug fix

### Test Plan

1. Use text on iOS.
2024-04-09 15:30:33 +00:00
Steve Ruiz dadb57edcd
Perf: block hit tests while moving camera (#3418)
This PR uses an element that prevents hit tests on shapes while the
camera is moving.


https://github.com/tldraw/tldraw/assets/23072548/9905f3d4-ba64-4e4d-ae99-194f513eaac8

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features


### Test Plan

1. Move the camera.
2. Interact with the canvas.
3. Zoom in and out.

### Release Notes

- Improves performance of canvas while the camera is moving.
2024-04-09 14:34:24 +00:00
Steve Ruiz 3f64bf8c5b
Perf: slightly faster `getShapeAtPoint` (#3416)
This PR makes a small improvement to the speed of `getShapeAtPoint`. It
removes `Editor.getCurrentPageRenderingShapesSorted`.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features
2024-04-09 12:57:46 +00:00
Mitja Bezenšek 6bc1566979 Do the simpler check first. 2024-04-09 14:02:45 +02:00
Mitja Bezenšek 29d225e1ee Remove rendering bounds expanded. 2024-04-09 13:48:36 +02:00
Mitja Bezenšek fd6152213f Remove logs. 2024-04-09 13:25:56 +02:00