cogentcore / core

A free and open source framework for building powerful, fast, and elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the Web with a single pure Go codebase, allowing you to Code Once, Run Everywhere.
http://cogentcore.org/core
BSD 3-Clause "New" or "Revised" License
1.31k stars 71 forks source link

TreeView DND leaves items highlighted; NaN in TreeView #945

Open rcoreilly opened 3 months ago

rcoreilly commented 3 months ago

Describe the bug

image

Curiously, the Widget and its parts both have no state flags set, but the parts has a StateLayer of .1 that persists despite my attempt to reset it.

Also I caught the inspector tree disappearing, which I've noticed before. getting a NaN in Size.Actual.Total.X, which results in Pos.Total.X = NaN as well. This happens at the top node and propagates downward.

How to reproduce

this is in Core. hopefully can reproduce in simple views test.

Example code

No response

Relevant output

No response

Platform

macOS

rcoreilly commented 3 months ago

The culprit appears to be actStateLayer, which we can't see, that is getting stuck. Indeed renaming that so it is visible shows that it is stuck. somehow in the TV widget Style func, the s.StateLayer is 0.1 and then it goes to 0 at some later point.

Moved the relevant code to a StyleFinal and that fixed it. also the DragDrop clear was operating on the wrong node -- source actually is the correct node.

added log error for the NaN -- will keep an eye out for that (and keeping this ticket open until we get that resolved).

kkoreilly commented 3 months ago

This highlights the classic tradeoff of hiding fields.