Skip to content

Commit

Permalink
use translate
Browse files Browse the repository at this point in the history
  • Loading branch information
yrns committed Dec 1, 2022
1 parent 33b172d commit 58e4381
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions edit_egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,6 @@ impl Drag {
}
}

// USE TRANSLATE
#[inline]
fn offset_rect(rect: Rect, offset: Vec2) -> Rect {
Rect::from_min_size(rect.min + offset, rect.size())
}

// These two functions are copied from egui::resize which isn't public...
fn paint_resize_corner(ui: &mut Ui, response: &Response) {
let stroke = ui.style().interact(response).fg_stroke;
Expand Down Expand Up @@ -311,7 +305,7 @@ impl Statechart<EditContext> {
Rect::from_min_size(state.rect.min + offset, state.rect.size() + *delta)
}
// Just the offset.
_ => offset_rect(state.rect, offset),
_ => state.rect.translate(offset),
};

// if ui.memory().is_being_dragged(id) {
Expand Down

0 comments on commit 58e4381

Please sign in to comment.