pull/3307/head
Mitja Bezenšek 2024-04-08 10:46:06 +02:00
rodzic d9e3486724
commit 8f3fedf297
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -3214,9 +3214,9 @@ export class Editor extends EventEmitter<TLEventMap> {
* @public
*/
@computed getRenderingShapes() {
const now = Date.now()
// const now = Date.now()
const renderingShapes = this.getUnorderedRenderingShapes(true)
console.log('getUnorderedRenderingShapes', Date.now() - now)
// console.log('getUnorderedRenderingShapes', Date.now() - now)
// Its IMPORTANT that the result be sorted by id AND include the index
// that the shape should be displayed at. Steve, this is the past you

Wyświetl plik

@ -44,11 +44,11 @@ export class SpatialIndex {
getShapesInsideBounds(bounds: Box): TLShapeId[] {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const now = Date.now()
// const now = Date.now()
const result = this.rBushIncremental().get()
const rbush = new TldrawRBush().fromJSON(result)
const r = rbush.search(bounds).map((b) => b.id)
console.log('shapes inside bounds', Date.now() - now, 'ms')
// console.log('shapes inside bounds', Date.now() - now, 'ms')
return r
}