Fix transparency toggle (#2964)

We recently changed the export checkbox ` Export Background` to `
Transparent` which are logically opposite, but we didn't flip the
`checked` state of the checkbox so it was exporting the background when
`Transparent` was checked!

Fixes #2941 

### Change Type

- [x] `patch` — Bug fix

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version

### Release Notes

- Fixes the Transparent toggle. The condition was accidentally flipped.
This commit is contained in:
David Sheldrick 2024-02-27 10:02:07 +00:00 committed by GitHub
parent d88ce929eb
commit 98850eb043
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -113,7 +113,7 @@ export function ToggleTransparentBgMenuItem() {
const editor = useEditor()
const isTransparentBg = useValue(
'isTransparentBg',
() => editor.getInstanceState().exportBackground,
() => !editor.getInstanceState().exportBackground,
[editor]
)
return <TldrawUiMenuCheckboxItem {...actions['toggle-transparent']} checked={isTransparentBg} />