Просмотр исходного кода

checks if panel child is an IPanel

leonsal 8 лет назад
Родитель
Сommit
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)
+			}
 		}
 	}