瀏覽代碼

checks if panel child is an IPanel

leonsal 8 年之前
父節點
當前提交
b4ade97dc9
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      gui/root.go

+ 4 - 2
gui/root.go

@@ -253,8 +253,10 @@ func (r *Root) sendPanels(x, y float32, evname string, ev interface{}) {
 		}
 		// Checks if any of its children also contains the position
 		for _, child := range pan.Children() {
-			ipan := child.(IPanel)
-			checkPanel(ipan)
+			ipan, ok := child.(IPanel)
+			if ok {
+				checkPanel(ipan)
+			}
 		}
 	}