mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
app/internal/gl: support Go 1.14 change to WebAssembly's js.Value
Gio programs will no longer build with Go 1.13; let's keep it at that until someone complains. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -25,11 +25,11 @@ func newContext(w *window) (*context, error) {
|
||||
}
|
||||
version := 2
|
||||
ctx := w.cnv.Call("getContext", "webgl2", args)
|
||||
if ctx == js.Null() {
|
||||
if ctx.IsNull() {
|
||||
version = 1
|
||||
ctx = w.cnv.Call("getContext", "webgl", args)
|
||||
}
|
||||
if ctx == js.Null() {
|
||||
if ctx.IsNull() {
|
||||
return nil, errors.New("app: webgl is not supported")
|
||||
}
|
||||
f := &gl.Functions{Ctx: ctx}
|
||||
|
||||
@@ -65,7 +65,7 @@ func NewWindow(win Callbacks, opts *Options) error {
|
||||
|
||||
func getContainer(doc js.Value) js.Value {
|
||||
cont := doc.Call("getElementById", "giowindow")
|
||||
if cont != js.Null() {
|
||||
if !cont.IsNull() {
|
||||
return cont
|
||||
}
|
||||
cont = doc.Call("createElement", "DIV")
|
||||
@@ -252,7 +252,7 @@ func (w *window) touchEvent(typ pointer.Type, e js.Value) {
|
||||
func (w *window) touchIDFor(touch js.Value) pointer.ID {
|
||||
id := touch.Get("identifier")
|
||||
for i, id2 := range w.touches {
|
||||
if id2 == id {
|
||||
if id2.Equal(id) {
|
||||
return pointer.ID(i)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user