Skip to content

Commit

Permalink
Merge 4f2a572 into 72c0d2b
Browse files Browse the repository at this point in the history
  • Loading branch information
Xoronic committed Oct 13, 2018
2 parents 72c0d2b + 4f2a572 commit 6bea04f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl<T: Layout> App<T> {
let mut ui_state_cache = Self::initialize_ui_state(&self.windows, &mut self.app_state);
let mut ui_description_cache = vec![UiDescription::default(); self.windows.len()];
let mut force_redraw_cache = vec![1_usize; self.windows.len()];
let mut parsed_css_cache = vec![None; self.windows.len()];
let mut parsed_css_cache: Vec<Option<ParsedCss>> = vec![None; self.windows.len()];
let mut awakened_task = vec![false; self.windows.len()];

#[cfg(debug_assertions)]
Expand Down Expand Up @@ -286,9 +286,20 @@ impl<T: Layout> App<T> {

if frame_event_info.should_redraw_window || force_redraw_cache[idx] > 0 {

if parsed_css_cache[idx].is_none() {
parsed_css_cache[idx] = Some(ParsedCss::from_css(&window.css));
#[cfg(not(debug_assertions))]
{
if parsed_css_cache[idx].is_none() {
parsed_css_cache[idx] = Some(ParsedCss::from_css(&window.css));
}
}

#[cfg(debug_assertions)]
{
if window.css.hot_reload_path.is_some() {
parsed_css_cache[idx] = Some(ParsedCss::from_css(&window.css));
}
}

let parsed_css = parsed_css_cache[idx].as_ref().unwrap();

// Call the Layout::layout() fn, get the DOM
Expand Down

0 comments on commit 6bea04f

Please sign in to comment.