@@ -206,18 +206,6 @@ rd_entity_from_handle(RD_Handle handle)
206
206
return result;
207
207
}
208
208
209
- internal RD_HandleList
210
- rd_handle_list_from_entity_list(Arena *arena, RD_EntityList entities)
211
- {
212
- RD_HandleList result = {0};
213
- for(RD_EntityNode *n = entities.first; n != 0; n = n->next)
214
- {
215
- RD_Handle handle = rd_handle_from_entity(n->entity);
216
- rd_handle_list_push(arena, &result, handle);
217
- }
218
- return result;
219
- }
220
-
221
209
//- rjf: entity recursion iterators
222
210
223
211
internal RD_EntityRec
@@ -6889,34 +6877,33 @@ rd_window_frame(RD_Window *ws)
6889
6877
////////////////////////////
6890
6878
//- rjf: animate panels
6891
6879
//
6892
- // TODO(rjf): @hack investigate why we were ever animating to a busted
6893
- // rectangle when minimized...
6894
- //
6895
- if(!os_window_is_minimized(ws->os))
6896
6880
{
6897
6881
F32 rate = rd_setting_val_from_code(RD_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-50.f * rd_state->frame_dt)) : 1.f;
6898
6882
Vec2F32 content_rect_dim = dim_2f32(content_rect);
6899
- for(RD_Panel *panel = ws->root_panel; !rd_panel_is_nil(panel); panel = rd_panel_rec_depth_first_pre(panel).next )
6883
+ if(content_rect_dim.x > 0 && content_rect_dim.y > 0 )
6900
6884
{
6901
- Rng2F32 target_rect_px = rd_target_rect_from_panel(content_rect, ws->root_panel, panel);
6902
- Rng2F32 target_rect_pct = r2f32p(target_rect_px.x0/content_rect_dim.x,
6903
- target_rect_px.y0/content_rect_dim.y,
6904
- target_rect_px.x1/content_rect_dim.x,
6905
- target_rect_px.y1/content_rect_dim.y);
6906
- if(abs_f32(target_rect_pct.x0 - panel->animated_rect_pct.x0) > 0.005f ||
6907
- abs_f32(target_rect_pct.y0 - panel->animated_rect_pct.y0) > 0.005f ||
6908
- abs_f32(target_rect_pct.x1 - panel->animated_rect_pct.x1) > 0.005f ||
6909
- abs_f32(target_rect_pct.y1 - panel->animated_rect_pct.y1) > 0.005f)
6910
- {
6911
- rd_request_frame();
6912
- }
6913
- panel->animated_rect_pct.x0 += rate * (target_rect_pct.x0 - panel->animated_rect_pct.x0);
6914
- panel->animated_rect_pct.y0 += rate * (target_rect_pct.y0 - panel->animated_rect_pct.y0);
6915
- panel->animated_rect_pct.x1 += rate * (target_rect_pct.x1 - panel->animated_rect_pct.x1);
6916
- panel->animated_rect_pct.y1 += rate * (target_rect_pct.y1 - panel->animated_rect_pct.y1);
6917
- if(ws->frames_alive < 5 || is_changing_panel_boundaries)
6885
+ for(RD_Panel *panel = ws->root_panel; !rd_panel_is_nil(panel); panel = rd_panel_rec_depth_first_pre(panel).next)
6918
6886
{
6919
- panel->animated_rect_pct = target_rect_pct;
6887
+ Rng2F32 target_rect_px = rd_target_rect_from_panel(content_rect, ws->root_panel, panel);
6888
+ Rng2F32 target_rect_pct = r2f32p(target_rect_px.x0/content_rect_dim.x,
6889
+ target_rect_px.y0/content_rect_dim.y,
6890
+ target_rect_px.x1/content_rect_dim.x,
6891
+ target_rect_px.y1/content_rect_dim.y);
6892
+ if(abs_f32(target_rect_pct.x0 - panel->animated_rect_pct.x0) > 0.005f ||
6893
+ abs_f32(target_rect_pct.y0 - panel->animated_rect_pct.y0) > 0.005f ||
6894
+ abs_f32(target_rect_pct.x1 - panel->animated_rect_pct.x1) > 0.005f ||
6895
+ abs_f32(target_rect_pct.y1 - panel->animated_rect_pct.y1) > 0.005f)
6896
+ {
6897
+ rd_request_frame();
6898
+ }
6899
+ panel->animated_rect_pct.x0 += rate * (target_rect_pct.x0 - panel->animated_rect_pct.x0);
6900
+ panel->animated_rect_pct.y0 += rate * (target_rect_pct.y0 - panel->animated_rect_pct.y0);
6901
+ panel->animated_rect_pct.x1 += rate * (target_rect_pct.x1 - panel->animated_rect_pct.x1);
6902
+ panel->animated_rect_pct.y1 += rate * (target_rect_pct.y1 - panel->animated_rect_pct.y1);
6903
+ if(ws->frames_alive < 5 || is_changing_panel_boundaries)
6904
+ {
6905
+ panel->animated_rect_pct = target_rect_pct;
6906
+ }
6920
6907
}
6921
6908
}
6922
6909
}
0 commit comments