Skip to content

Commit

Permalink
feat: use save and restore instead of reset because of firefox compat…
Browse files Browse the repository at this point in the history
…ibility
  • Loading branch information
maximeperrault committed Dec 26, 2024
1 parent 659faa1 commit da5ad7f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export function ExportLayer({ onImagesReady, shouldLoadImages }: ExportLayerProp
const allFeatures: Feature[] = []
const mapCanvas = mapRef.current.getViewport().querySelector('canvas')!
const mapContext = mapCanvas.getContext('2d')
mapContext?.save()
let dashboardAreaFeature: Feature | undefined

layersVectorSourceRef.current.clear(true)
Expand Down Expand Up @@ -268,7 +269,7 @@ export function ExportLayer({ onImagesReady, shouldLoadImages }: ExportLayerProp

// eslint-disable-next-line no-restricted-syntax
for (const feature of allFeatures) {
mapContext?.reset()
mapContext?.restore()
layersVectorSourceRef.current.clear(true)
layersVectorSourceRef.current.addFeature(feature)

Expand Down

0 comments on commit da5ad7f

Please sign in to comment.