Skip to content

Commit

Permalink
format files
Browse files Browse the repository at this point in the history
  • Loading branch information
cfraz89 committed Aug 31, 2024
1 parent 2b362d5 commit f54bcc4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
10 changes: 8 additions & 2 deletions packages/dom/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,14 @@ impl Document {
let new_scroll = (self.viewport_scroll.x - x, self.viewport_scroll.y - y);
let window_width = self.viewport.window_size.0 as f64 / self.viewport.scale() as f64;
let window_height = self.viewport.window_size.1 as f64 / self.viewport.scale() as f64;
self.viewport_scroll.x = f64::max(0.0, f64::min(new_scroll.0, content_size.width as f64 - window_width));
self.viewport_scroll.y = f64::max(0.0, f64::min(new_scroll.1, content_size.height as f64 - window_height))
self.viewport_scroll.x = f64::max(
0.0,
f64::min(new_scroll.0, content_size.width as f64 - window_width),
);
self.viewport_scroll.y = f64::max(
0.0,
f64::min(new_scroll.1, content_size.height as f64 - window_height),
)
}

pub fn viewport_scroll(&self) -> kurbo::Point {
Expand Down
2 changes: 1 addition & 1 deletion packages/dom/src/node.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use atomic_refcell::{AtomicRef, AtomicRefCell};
use html5ever::{local_name, LocalName, QualName};
use image::DynamicImage;
use peniko::kurbo;
use selectors::matching::QuirksMode;
use slab::Slab;
use std::cell::RefCell;
Expand All @@ -12,7 +13,6 @@ use style::invalidation::element::restyle_hints::RestyleHint;
use style::values::computed::Display;
use style::values::specified::box_::{DisplayInside, DisplayOutside};
use style_dom::ElementState;
use peniko::kurbo;
// use string_cache::Atom;
use parley;
use style::properties::ComputedValues;
Expand Down
1 change: 0 additions & 1 deletion packages/dom/src/viewport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub struct Viewport {
zoom: f32,

pub font_size: f32,

}

impl Viewport {
Expand Down

0 comments on commit f54bcc4

Please sign in to comment.