Skip to content

Commit

Permalink
rename enable_web_scroll -> enable_web_page_scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Jul 12, 2022
1 parent bd48572 commit 5850030
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ And please only add new entries to the top of this list, right below the `# Unre
- Added `Window::is_decorated`.
- On X11, fix for repeated event loop iteration when `ControlFlow` was `Wait`
- On X11, fix scale factor calculation when the only monitor is reconnected
- On web, by default, when the canvas is focused, scrolling of the webpage is disabled. It can however be enabled via the `WindowBuilderExtWebSys::enable_web_scroll` method.
- On web, by default, when the canvas is focused, scrolling of the webpage is disabled. It can however be enabled via the `WindowBuilderExtWebSys::enable_web_page_scroll` method.
- On Wayland, report unaccelerated mouse deltas in `DeviceEvent::MouseMotion`.
- On Web, a focused event is manually generated when a click occurs to emulate behaviour of other backends.
- **Breaking:** Bump `ndk` version to 0.6, ndk-sys to `v0.3`, `ndk-glue` to `0.6`.
Expand Down
6 changes: 3 additions & 3 deletions src/platform/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ pub trait WindowBuilderExtWebSys {
///
/// So only call this method if you know that you will never need to handle mouse wheel inputs
/// or click and dragging.
fn enable_web_scroll(self) -> Self;
fn enable_web_page_scroll(self) -> Self;

fn with_canvas(self, canvas: Option<HtmlCanvasElement>) -> Self;
}

impl WindowBuilderExtWebSys for WindowBuilder {
fn enable_web_scroll(mut self) -> Self {
self.platform_specific.enable_web_scroll = true;
fn enable_web_page_scroll(mut self) -> Self {
self.platform_specific.enable_web_page_scroll = true;

self
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/web/web_sys/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl Canvas {
wants_fullscreen: Rc::new(RefCell::new(false)),
};

let disable_web_scroll = if !attr.enable_web_scroll {
let disable_web_scroll = if !attr.enable_web_page_scroll {
Some([
common.add_event("pointermove", move |event: Event| {
event.prevent_default();
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/web/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,5 +395,5 @@ impl From<u64> for WindowId {
#[derive(Default, Clone)]
pub struct PlatformSpecificWindowBuilderAttributes {
pub(crate) canvas: Option<backend::RawCanvasType>,
pub(crate) enable_web_scroll: bool,
pub(crate) enable_web_page_scroll: bool,
}

0 comments on commit 5850030

Please sign in to comment.