Skip to content

Commit

Permalink
fix: svg not showing in vanilla uikit
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohlender committed Jun 26, 2024
1 parent e4de97b commit d156fa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/vanilla/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const c = new Content({ flexShrink: 0, height: 100, backgroundColor: 'black' })
const loader = new GLTFLoader()
loader.load('example.glb', (gltf) => c.add(gltf.scene))
const del = new Delete({ width: 100, flexShrink: 0 })
const svg = new Svg({ src: 'example.svg', height: '20%', flexShrink: 0 })
const svg = new Svg({ src: 'example.svg', width: 100, height: 100, flexShrink: 0 })
const text = new Text('Hello World', { fontSize: 40, flexShrink: 0 })
const a = new Container({ flexShrink: 0, alignSelf: 'stretch', flexGrow: 1, backgroundColor: 'blue' })
const x = new Container({
Expand Down
3 changes: 2 additions & 1 deletion packages/uikit/src/vanilla/svg.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AllOptionalProperties } from '../properties/default.js'
import { Parent, createParentContextSignal, bindHandlers } from './utils.js'
import { Parent, createParentContextSignal, bindHandlers, setupParentContextSignal } from './utils.js'
import { ReadonlySignal, Signal, effect, signal, untracked } from '@preact/signals-core'
import { Subscriptions, initialize, unsubscribeSubscriptions } from '../utils.js'
import { SvgProperties, createSvg } from '../components/svg.js'
Expand All @@ -18,6 +18,7 @@ export class Svg extends Parent {
constructor(properties?: SvgProperties, defaultProperties?: AllOptionalProperties) {
super()
this.matrixAutoUpdate = false
setupParentContextSignal(this.parentContextSignal, this)
this.propertiesSignal = signal(properties)
this.defaultPropertiesSignal = signal(defaultProperties)

Expand Down

0 comments on commit d156fa3

Please sign in to comment.