Skip to content

Commit

Permalink
Temporary merge of IFrame rendering into master
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Oct 7, 2018
1 parent 2c18d82 commit 859b289
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/display_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ fn insert_constraints_into_solver<'a, T: Layout>(

// inefficient for now, but prevents memory leak
dom_solver.clear_all_constraints();

let constraints: Vec<Constraint> = {
let borrow = &*ui_description.ui_descr_arena.borrow();
rectangles.linear_iter().flat_map(|rect_idx| {
Expand All @@ -356,7 +355,7 @@ fn insert_constraints_into_solver<'a, T: Layout>(
}).collect()
};

dom_solver.insert_css_constraints(&constraints);
dom_solver.insert_css_constraints(constraints);

// If we push or pop constraints that means we also need to re-layout the window
has_window_size_changed = true;
Expand Down
1 change: 1 addition & 0 deletions src/id_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ trait GetPairMut<T> {
}

impl<T> GetPairMut<T> for Vec<T> {
#[allow(unused_variables)]
fn get_pair_mut(&mut self, a: usize, b: usize, same_index_error_message: &'static str)
-> (&mut T, &mut T)
{
Expand Down
4 changes: 2 additions & 2 deletions src/ui_solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ impl DomSolver {
changeset
}

pub(crate) fn insert_css_constraints(&mut self, constraints: &[Constraint]) {
pub(crate) fn insert_css_constraints(&mut self, constraints: Vec<Constraint>) {
// TODO: Solver currently locks up here when inserting 5000 constraints
self.solver.add_constraints(constraints).unwrap();
self.solver.add_constraints(&constraints).unwrap();
}

/// Notifies the solver that the window size has changed
Expand Down
7 changes: 4 additions & 3 deletions src/widgets/table_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ impl Default for TableViewState {
fn default() -> Self {
Self {
work_sheet: Worksheet::default(),
column_width: 50.0,
row_height: 10.0,
// warning: 50 / 100 doesn't work - too many constraints, slow rendering, need to debug this!
column_width: 500.0,
row_height: 100.0,
selected_cell: None,
}
}
Expand Down Expand Up @@ -61,7 +62,7 @@ fn render_table_callback<T: Layout>(ptr: &StackCheckedPointer<T>, info: WindowIn
unsafe { ptr.invoke_mut_iframe(render_table, info, dimensions) }
}

fn render_table<T: Layout>(state: &mut TableViewState, info: WindowInfo<T>, dimensions: HidpiAdjustedBounds)
fn render_table<T: Layout>(state: &mut TableViewState, _info: WindowInfo<T>, dimensions: HidpiAdjustedBounds)
-> Dom<T>
{
let necessary_columns = (dimensions.logical_size.width as f32 / state.column_width).ceil() as usize;
Expand Down

0 comments on commit 859b289

Please sign in to comment.