mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
app: change background for js
Default window background is white. JS default background is transparent black. Signed-off-by: Paulo Melo <paulo.durrer.melo@gmail.com>
This commit is contained in:
@@ -86,7 +86,13 @@ func (l *renderLoop) renderLoop(ctx window.Context) error {
|
|||||||
l.refreshErr <- ctx.MakeCurrent()
|
l.refreshErr <- ctx.MakeCurrent()
|
||||||
case frame := <-l.frames:
|
case frame := <-l.frames:
|
||||||
ctx.Lock()
|
ctx.Lock()
|
||||||
|
if runtime.GOOS == "js" {
|
||||||
|
// Use transparent black when Gio is embedded, to allow mixing of Gio and
|
||||||
|
// foreign content below.
|
||||||
|
g.Clear(color.NRGBA{A: 0x00, R: 0x00, G: 0x00, B: 0x00})
|
||||||
|
} else {
|
||||||
g.Clear(color.NRGBA{A: 0xff, R: 0xff, G: 0xff, B: 0xff})
|
g.Clear(color.NRGBA{A: 0xff, R: 0xff, G: 0xff, B: 0xff})
|
||||||
|
}
|
||||||
g.Collect(frame.viewport, frame.ops)
|
g.Collect(frame.viewport, frame.ops)
|
||||||
// Signal that we're done with the frame ops.
|
// Signal that we're done with the frame ops.
|
||||||
l.ack <- struct{}{}
|
l.ack <- struct{}{}
|
||||||
|
|||||||
Reference in New Issue
Block a user