ianharrigan / haxeui-file-dialogs

File dialogs for HaxeUI
7 stars 2 forks source link

Big framedrop caused by button with no text. #4

Open tiagolr opened 10 years ago

tiagolr commented 10 years ago

When i open file dialogs my app frame-rate drops from 60 to 30, witch is A LOT of CPU being used. I narrowed this problem to FileSelectionController -> refreshPathControls():

What happens is that the last path button is a button with text = "". If i remove that entry the frame rates are normal.

So this is a very easy thing to fix (witch i did already), however I have no clue what is causing the framedrop and it may happen again in the future, here are a few notes:

Strange stuff, I'll have another go later.

ianharrigan commented 10 years ago

Hmmm... sounds very strange certainly. Ill check it out too when i get a moment.

tiagolr commented 10 years ago

Its easy to see it in action, as it is, just open the file dialogs with a FPS counter added, if you put a guard like:

if (a == "") continue; in FileSelectionController.hx -> refreshPathControls():

it removes the trailing button (witch is a bug already) and the fps stays normal.