image: Move most functions to imp module
This commit is contained in:
parent
3d5ef4038e
commit
db6a7e7f2a
13 changed files with 534 additions and 314 deletions
|
|
@ -20,6 +20,8 @@ use super::*;
|
|||
impl LpImage {
|
||||
/// Stepwise scrolls inside an image when zoomed in
|
||||
pub fn pan(&self, direction: >k::PanDirection) {
|
||||
let imp = self.imp();
|
||||
|
||||
let sign = match direction {
|
||||
gtk::PanDirection::Left | gtk::PanDirection::Up => -1.,
|
||||
gtk::PanDirection::Right | gtk::PanDirection::Down => 1.,
|
||||
|
|
@ -31,10 +33,10 @@ impl LpImage {
|
|||
|
||||
let (adjustment, max) = match direction {
|
||||
gtk::PanDirection::Left | gtk::PanDirection::Right => {
|
||||
(self.hadjustment(), self.max_hadjustment_value())
|
||||
(self.hadjustment(), imp.max_hadjustment_value())
|
||||
}
|
||||
gtk::PanDirection::Up | gtk::PanDirection::Down => {
|
||||
(self.vadjustment(), self.max_vadjustment_value())
|
||||
(self.vadjustment(), imp.max_vadjustment_value())
|
||||
}
|
||||
_ => {
|
||||
log::error!("Unknown pan direction {direction:?}");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue