Browse Source

fix(whiteboard): disable dot grid background for iOS & iPad

Peng Xiao 2 years ago
parent
commit
8bf59a564b

+ 2 - 1
tldraw/packages/core/src/lib/TLSettings.ts

@@ -1,5 +1,6 @@
 /* eslint-disable @typescript-eslint/no-explicit-any */
 /* eslint-disable @typescript-eslint/no-explicit-any */
 import { observable, makeObservable, action } from 'mobx'
 import { observable, makeObservable, action } from 'mobx'
+import { isSafari } from '../utils'
 
 
 export interface TLSettingsProps {
 export interface TLSettingsProps {
   mode: 'light' | 'dark'
   mode: 'light' | 'dark'
@@ -12,7 +13,7 @@ export class TLSettings implements TLSettingsProps {
   }
   }
 
 
   @observable mode: 'dark' | 'light' = 'light'
   @observable mode: 'dark' | 'light' = 'light'
-  @observable showGrid = true
+  @observable showGrid = !isSafari()
 
 
   @action update(props: Partial<TLSettingsProps>): void {
   @action update(props: Partial<TLSettingsProps>): void {
     Object.assign(this, props)
     Object.assign(this, props)

+ 1 - 0
tldraw/packages/react/src/components/ui/Grid/Grid.tsx

@@ -10,6 +10,7 @@ const STEPS = [
   [0.7, 2.5, 1],
   [0.7, 2.5, 1],
 ]
 ]
 
 
+// Grid is slow to render. Maybe we render it using canvas?
 export const Grid = observer(function Grid({ size }: TLGridProps) {
 export const Grid = observer(function Grid({ size }: TLGridProps) {
   const {
   const {
     viewport: {
     viewport: {