Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge winit 0.22.2 #1

Open
wants to merge 59 commits into
base: wasm
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
28023d9
upgrades x11-dl to 2.18.5 to fix #376 (#1517)
Mar 26, 2020
0bc58f6
Fix warnings (#1530)
murarth Apr 10, 2020
a8e777a
Fix a possible double-borrow during event handling (#1512)
ryanisaacg Apr 11, 2020
1f24a09
Implement `requestAnimationFrame` for web (#1519)
chemicstry Apr 11, 2020
d560972
Bump version to 0.22.1 (#1537)
ryanisaacg Apr 17, 2020
4c4d091
control_flow example: fix wait_cancelled logic again (#1511)
filnet Apr 19, 2020
6dae994
Mention raw-window-handle in library docs (#1528)
Ralith Apr 19, 2020
78a62ec
Added more docs.rs targets (#1521)
simlay Apr 19, 2020
aabe42d
Preserve with_maximized on windows (#1515)
yanchith Apr 19, 2020
849b8f5
Clarify when RedrawRequested is useful (#1529)
Ralith Apr 19, 2020
47ff8d6
Document that platforms will display garbage data in the window by de…
Osspial Apr 20, 2020
54bc41f
Implement `Drop` for `Proxy` on macOS platform (#1526)
hecrj Apr 20, 2020
114fe9d
wayland: rework scale factor handling (#1538)
Matthias-Fauconneau Apr 22, 2020
26775fa
Report mouse motion before click (#1490)
chrisduerr Apr 26, 2020
9975ced
update macos libs
j4qfrost Apr 27, 2020
36ab890
modify dependency
j4qfrost May 2, 2020
f3b4992
changelog
j4qfrost May 2, 2020
b4c6cdf
Fix several crashes on Windows by heavily simplifying the event loop …
Osspial May 4, 2020
007b195
iOS: convert touch positions to physical (#1551)
francesca64 May 4, 2020
b882810
add android NDK event loop (#1556)
JasperDeSutter May 6, 2020
8f230f4
update core-video-sys version
j4qfrost May 6, 2020
3c38afd
Update macOS dependencies (#1554)
j4qfrost May 8, 2020
aeb4866
Merge remote-tracking branch 'upstream/master'
j4qfrost May 8, 2020
501341d
move changelog line
j4qfrost May 8, 2020
c7a33f9
Fixed a couple of typos in repo description (#1568)
May 15, 2020
bc19c04
Fixed changelog line for core-* dependencies (#1561)
j4qfrost May 15, 2020
878c179
Implement Clone for 'static events (#1478)
semtexzv May 15, 2020
49bcec1
Release 0.22.2 (#1570)
Osspial May 16, 2020
6cfddfe
Prevent the default browser behavior of events (#1576)
ryanisaacg May 21, 2020
ff66bdd
On Wayland, fix deadlock when calling set_inner_size from event loop
kchibisov May 22, 2020
03335ce
macOS: add function to hide other applications
freamon May 24, 2020
a4121a2
platform_impl/linux/x11: fix deadlock in fn set_fullscreen_inner (#1579)
May 27, 2020
5a6cfc3
Macos fullscreen & dialog support with `run_return` (#1581)
VZout Jun 9, 2020
c1ea0dd
On Unix, add option to pick backends
ogoffart Jun 15, 2020
4b1b314
Test x11 and wayland features on CI
murarth Jun 15, 2020
bf62103
Android run return (#1604)
VZout Jun 17, 2020
2191e9e
macOS: Support click-dragging out of a window (#1607)
ozkriff Jun 20, 2020
b1e22aa
Make drag and drop optional (fixes OleInitialize failure #1255) (#1524)
chemicstry Jun 28, 2020
dd866a7
On Windows, fix bug where we'd try to emit `MainEventsCleared` events…
Osspial Jul 2, 2020
3d5d05e
Move available_monitors and primary_monitor to EventLoopWindowTarget …
AdminXVII Jul 4, 2020
6919c2f
Fix misspellings in comments (#1618)
kraai Jul 9, 2020
55dff53
Fix Window platform support documentation
chrisduerr Jul 26, 2020
40232d4
Use `PhysicalPosition` in `PixelDelta` event
chrisduerr Jul 26, 2020
7a49c88
Fix with_fullscreen signature
chrisduerr Aug 1, 2020
05fdcb5
Web: Use mouse events instead of pointer events if the latter isn't s…
hayashi-stl Aug 5, 2020
6810010
android: fix event loop polling (#1638)
msiglreith Aug 12, 2020
514ab04
[macos] add NSWindow.hasShadow support (#1637)
TakWolf Aug 13, 2020
412bd94
Renamed NSString to NSStringRust to support Debug View Heirarchy in X…
simlay Aug 14, 2020
9c72cc2
Fix HiDPI vs. set_cursor_icon for web (#1652)
michaelkirk Aug 17, 2020
89d4c06
Fix crash on NetBSD
chrisduerr Aug 20, 2020
6ba583d
Fix vertical scroll being inverted on web targets (#1665)
alvinhochun Aug 21, 2020
0f7c82d
Send CursorMove before mouse press event and note that touch is unimp…
alvinhochun Aug 22, 2020
bea6093
Use send_events instead of send_event in web backend (#1681)
alvinhochun Aug 26, 2020
02a34a1
Impl. mouse capturing on web target (#1672)
alvinhochun Aug 29, 2020
a2db4c0
Unify Minus/Subtract virtual keycodes
chrisduerr Aug 29, 2020
658a9a4
Handle scale factor change on web-sys backend (#1690)
alvinhochun Aug 30, 2020
4a1939c
Merge branch 'wasm' of github.com:amethyst/winit into wasm
j4qfrost Sep 4, 2020
a764327
Merge branch 'master' into wasm
j4qfrost Sep 4, 2020
c142719
housekeeping
j4qfrost Sep 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,24 @@ jobs:
- { target: i686-pc-windows-gnu, os: windows-latest, host: -i686-pc-windows-gnu }
- { target: i686-unknown-linux-gnu, os: ubuntu-latest, }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: x11 }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: wayland }
- { target: aarch64-linux-android, os: ubuntu-latest, cmd: 'apk --' }
- { target: x86_64-apple-darwin, os: macos-latest, }
- { target: x86_64-apple-ios, os: macos-latest, }
- { target: aarch64-apple-ios, os: macos-latest, }
# We're using Windows rather than Ubuntu to run the wasm tests because caching cargo-web
# doesn't currently work on Linux.
- { target: wasm32-unknown-unknown, os: windows-latest, features: stdweb, web: web }
- { target: wasm32-unknown-unknown, os: windows-latest, features: web-sys, web: web }
- { target: wasm32-unknown-unknown, os: windows-latest, features: stdweb, cmd: web }
- { target: wasm32-unknown-unknown, os: windows-latest, features: web-sys, cmd: web }

env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"
OPTIONS: ${{ matrix.platform.options }}
FEATURES: ${{ format(',{0}', matrix.platform.features ) }}
WEB: ${{ matrix.platform.web }}
CMD: ${{ matrix.platform.cmd }}

runs-on: ${{ matrix.platform.os }}
steps:
Expand All @@ -70,6 +74,9 @@ jobs:
- name: Install GCC Multilib
if: (matrix.platform.os == 'ubuntu-latest') && contains(matrix.platform.target, 'i686')
run: sudo apt-get update && sudo apt-get install gcc-multilib
- name: Install cargo-apk
if: contains(matrix.platform.target, 'android')
run: cargo install cargo-apk
- name: Install cargo-web
continue-on-error: true
if: contains(matrix.platform.target, 'wasm32')
Expand All @@ -78,29 +85,35 @@ jobs:
- name: Check documentation
shell: bash
if: matrix.platform.target != 'wasm32-unknown-unknown'
run: cargo doc --no-deps --target ${{ matrix.platform.target }} --features $FEATURES
run: cargo $CMD doc --no-deps --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES

- name: Build
shell: bash
run: cargo $WEB build --verbose --target ${{ matrix.platform.target }} --features $FEATURES
run: cargo $CMD build --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES

- name: Build tests
shell: bash
run: cargo $WEB test --no-run --verbose --target ${{ matrix.platform.target }} --features $FEATURES
run: cargo $CMD test --no-run --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES
- name: Run tests
shell: bash
if: (!contains(matrix.platform.target, 'ios') && !contains(matrix.platform.target, 'wasm32'))
run: cargo $WEB test --verbose --target ${{ matrix.platform.target }} --features $FEATURES
if: (
!contains(matrix.platform.target, 'android') &&
!contains(matrix.platform.target, 'ios') &&
!contains(matrix.platform.target, 'wasm32'))
run: cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES


- name: Build with serde enabled
shell: bash
run: cargo $WEB build --verbose --target ${{ matrix.platform.target }} --features serde,$FEATURES
run: cargo $CMD build --verbose --target ${{ matrix.platform.target }} $OPTIONS --features serde,$FEATURES

- name: Build tests with serde enabled
shell: bash
run: cargo $WEB test --no-run --verbose --target ${{ matrix.platform.target }} --features serde,$FEATURES
run: cargo $CMD test --no-run --verbose --target ${{ matrix.platform.target }} $OPTIONS --features serde,$FEATURES
- name: Run tests with serde enabled
shell: bash
if: (!contains(matrix.platform.target, 'ios') && !contains(matrix.platform.target, 'wasm32'))
run: cargo $WEB test --verbose --target ${{ matrix.platform.target }} --features serde,$FEATURES
if: (
!contains(matrix.platform.target, 'android') &&
!contains(matrix.platform.target, 'ios') &&
!contains(matrix.platform.target, 'wasm32'))
run: cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features serde,$FEATURES
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,49 @@
# Unreleased

- On iOS, fixed support for the "Debug View Heirarchy" feature in Xcode.
- On all platforms, `available_monitors` and `primary_monitor` are now on `EventLoopWindowTarget` rather than `EventLoop` to list monitors event in the event loop.
- On Unix, X11 and Wayland are now optional features (enabled by default)
- On X11, fix deadlock when calling `set_fullscreen_inner`.
- On Web, prevent the webpage from scrolling when the user is focused on a winit canvas
- On Web, calling `window.set_cursor_icon` no longer breaks HiDPI scaling
- On Windows, drag and drop is now optional and must be enabled with `WindowBuilderExtWindows::with_drag_and_drop(true)`.
- On Wayland, fix deadlock when calling to `set_inner_size` from a callback.
- On macOS, add `hide__other_applications` to `EventLoopWindowTarget` via existing `EventLoopWindowTargetExtMacOS` trait. `hide_other_applications` will hide other applications by calling `-[NSApplication hideOtherApplications: nil]`.
- On android added support for `run_return`.
- On MacOS, Fixed fullscreen and dialog support for `run_return`.
- On Windows, fix bug where we'd try to emit `MainEventsCleared` events during nested win32 event loops.
- On Web, use mouse events if pointer events aren't supported. This affects Safari.
- On Windows, `set_ime_position` is now a no-op instead of a runtime crash.
- On Android, `set_fullscreen` is now a no-op instead of a runtime crash.
- On iOS and Android, `set_inner_size` is now a no-op instead of a runtime crash.
- On Android, fix `ControlFlow::Poll` not polling the Android event queue.
- On macOS, add `NSWindow.hasShadow` support.
- On Web, fix vertical mouse wheel scrolling being inverted.
- On Web, implement mouse capturing for click-dragging out of the canvas.
- On Web, fix `ControlFlow::Exit` not properly handled.
- On Web (web-sys only), send `WindowEvent::ScaleFactorChanged` event when `window.devicePixelRatio` is changed.
- **Breaking:** On Web, `set_cursor_position` and `set_cursor_grab` will now always return an error.
- **Breaking:** `PixelDelta` scroll events now return a `PhysicalPosition`.
- On NetBSD, fixed crash due to incorrect detection of the main thread.
- **Breaking:** The virtual key code `Subtract` has been renamed to `NumpadSubtract`
- **Breaking:** On X11, `-` key is mapped to the `Minus` virtual key code, instead of `Subtract`

# 0.22.2 (2020-05-16)

- Added Clone implementation for 'static events.
- On Windows, fix window intermittently hanging when `ControlFlow` was set to `Poll`.
- On Windows, fix `WindowBuilder::with_maximized` being ignored.
- On Android, minimal platform support.
- On iOS, touch positions are now properly converted to physical pixels.
- On macOS, updated core-* dependencies and cocoa

# 0.22.1 (2020-04-16)

- On X11, fix `ResumeTimeReached` being fired too early.
- On Web, replaced zero timeout for `ControlFlow::Poll` with `requestAnimationFrame`
- On Web, fix a possible panic during event handling
- On macOS, fix `EventLoopProxy` leaking memory for every instance.
- On Windows, drag and drop can now be disabled with `WindowBuilderExtWindows::with_drag_and_drop(false)`.
- Added `Clone` implementation for `'static` events.
- On Web, replaced zero timeout for `ControlFlow::Poll` with `requestAnimationFrame`
- On Web, fix a possible panic during event handling
Expand All @@ -26,6 +69,7 @@
- Revert On macOS, fix not sending ReceivedCharacter event for specific keys combinations.
- on macOS, fix incorrect ReceivedCharacter events for some key combinations.
- **Breaking:** Use `i32` instead of `u32` for position type in `WindowEvent::Moved`.
- On macOS, a mouse motion event is now generated before every mouse click.

# 0.21.0 (2020-02-04)

Expand Down
30 changes: 19 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "winit"
version = "0.22.0"
version = "0.22.2"
authors = ["The winit contributors", "Pierre Krieger <[email protected]>"]
description = "Cross-platform window creation library."
edition = "2018"
Expand All @@ -12,11 +12,16 @@ documentation = "https://docs.rs/winit"
categories = ["gui"]

[package.metadata.docs.rs]
features = ["serde"]
features = ["serde", "web-sys"]
default-target = "x86_64-unknown-linux-gnu"
targets = ["i686-pc-windows-msvc", "x86_64-pc-windows-msvc", "i686-unknown-linux-gnu", "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "wasm32-unknown-unknown"]

[features]
default = ["x11", "wayland"]
web-sys = ["web_sys", "wasm-bindgen", "instant/wasm-bindgen"]
stdweb = ["std_web", "instant/stdweb"]
x11 = ["x11-dl"]
wayland = ["wayland-client", "smithay-client-toolkit"]

[dependencies]
instant = "0.1"
Expand All @@ -31,21 +36,23 @@ bitflags = "1"
image = "0.23"
simple_logger = "1"

[target.'cfg(target_os = "android")'.dependencies.android_glue]
version = "0.2"
[target.'cfg(target_os = "android")'.dependencies]
ndk = "0.1.0"
ndk-sys = "0.1.0"
ndk-glue = "0.1.0"

[target.'cfg(target_os = "ios")'.dependencies]
objc = "0.2.3"

[target.'cfg(target_os = "macos")'.dependencies]
cocoa = "0.19.1"
core-foundation = "0.6"
core-graphics = "0.17.3"
cocoa = "0.20"
core-foundation = "0.7"
core-graphics = "0.19"
dispatch = "0.2.0"
objc = "0.2.6"

[target.'cfg(target_os = "macos")'.dependencies.core-video-sys]
version = "0.1.3"
version = "0.1.4"
default_features = false
features = ["display_link"]

Expand Down Expand Up @@ -74,11 +81,11 @@ features = [
]

[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
wayland-client = { version = "0.23.0", features = [ "dlopen", "egl", "cursor", "eventloop"] }
wayland-client = { version = "0.23.0", features = [ "dlopen", "egl", "cursor", "eventloop"] , optional = true }
mio = "0.6"
mio-extras = "2.0"
smithay-client-toolkit = "^0.6.6"
x11-dl = "2.18.3"
smithay-client-toolkit = { version = "^0.6.6", optional = true }
x11-dl = { version = "2.18.5", optional = true }
percent-encoding = "2.0"

[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd", target_os = "windows"))'.dependencies.parking_lot]
Expand All @@ -90,6 +97,7 @@ version = "0.3.22"
optional = true
features = [
'console',
"AddEventListenerOptions",
'CssStyleDeclaration',
'BeforeUnloadEvent',
'Document',
Expand Down
14 changes: 8 additions & 6 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ If your PR makes notable changes to Winit's features, please update this section
translating keypresses into UTF-8 characters, handling dead keys and IMEs.
- **Drag & Drop**: Dragging content into winit, detecting when content enters, drops, or if the drop is cancelled.
- **Raw Device Events**: Capturing input from input devices without any OS filtering.
- **Gamepad/Joystick events**: Capturing input from gampads and joysticks.
- **Device movement events:**: Capturing input from the device gyroscope and accelerometer.
- **Gamepad/Joystick events**: Capturing input from gamepads and joysticks.
- **Device movement events**: Capturing input from the device gyroscope and accelerometer.

## Platform
### Windows
Expand Down Expand Up @@ -182,9 +182,11 @@ Legend:
|Fullscreen |✔️ |✔️ |✔️ |✔️ |**N/A**|✔️ |✔️ |
|Fullscreen toggle |✔️ |✔️ |✔️ |✔️ |**N/A**|✔️ |✔️ |
|Exclusive fullscreen |✔️ |✔️ |✔️ |**N/A** |❌ |✔️ |**N/A**|
|HiDPI support |✔️ |✔️ |✔️ |✔️ |▢[#721]|✔️ |**N/A**|
|HiDPI support |✔️ |✔️ |✔️ |✔️ |▢[#721]|✔️ |✔️ \*1|
|Popup windows |❌ |❌ |❌ |❌ |❌ |❌ |**N/A**|

\*1: `WindowEvent::ScaleFactorChanged` is not sent on `stdweb` backend.

### System information
|Feature |Windows|MacOS |Linux x11|Linux Wayland|Android|iOS |WASM |
|---------------- | ----- | ---- | ------- | ----------- | ----- | ------- | -------- |
Expand All @@ -198,9 +200,9 @@ Legend:
|Mouse set location |✔️ |✔️ |✔️ |❓ |**N/A**|**N/A**|**N/A**|
|Cursor grab |✔️ |▢[#165] |▢[#242] |✔️ |**N/A**|**N/A**|❓ |
|Cursor icon |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**|✔️ |
|Touch events |✔️ |❌ |✔️ |✔️ |✔️ |✔️ |✔️ |
|Touch pressure |✔️ |❌ |❌ |❌ |❌ |✔️ |✔️ |
|Multitouch |✔️ |❌ |✔️ |✔️ |❓ |✔️ |✔️ |
|Touch events |✔️ |❌ |✔️ |✔️ |✔️ |✔️ | |
|Touch pressure |✔️ |❌ |❌ |❌ |❌ |✔️ | |
|Multitouch |✔️ |❌ |✔️ |✔️ |❓ |✔️ | |
|Keyboard events |✔️ |✔️ |✔️ |✔️ |❓ |❌ |✔️ |
|Drag & Drop |▢[#720] |▢[#720] |▢[#720] |❌[#306] |**N/A**|**N/A**|❓ |
|Raw Device Events |▢[#750] |▢[#750] |▢[#750] |❌ |❌ |❌ |❓ |
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

```toml
[dependencies]
winit = "0.22.0"
winit = "0.22.2"
```

## [Documentation](https://docs.rs/winit)
Expand Down Expand Up @@ -64,6 +64,8 @@ Winit is only officially supported on the latest stable version of the Rust comp

Winit provides the following features, which can be enabled in your `Cargo.toml` file:
* `serde`: Enables serialization/deserialization of certain types with [Serde](https://crates.io/crates/serde).
* `x11` (enabled by default): On Unix platform, compiles with the X11 backend
* `wayland` (enabled by default): On Unix platform, compiles with the Wayland backend

### Platform-specific usage

Expand All @@ -76,3 +78,22 @@ Building a binary will yield a `.js` file. In order to use it in an HTML file, y
the element of the `<canvas>` element (in the example you would retrieve it via `document.getElementById("my_id")`).
More information [here](https://kripken.github.io/emscripten-site/docs/api_reference/module.html).
- Make sure that you insert the `.js` file generated by Rust after the `Module` variable is created.

#### Android

This library makes use of the [ndk-rs](https://github.com/rust-windowing/android-ndk-rs) crates, refer to that repo for more documentation.

Running on an Android device needs a dynamic system library, add this to Cargo.toml:
```toml
[[example]]
name = "request_redraw_threaded"
crate-type = ["cdylib"]
```

And add this to the example file to add the native activity glue:
```rust
#[cfg(target_os = "android")]
ndk_glue::ndk_glue!(main);
```

And run the application with `cargo apk run --example request_redraw_threaded`
21 changes: 21 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#[cfg(all(
any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
),
not(feature = "x11"),
not(feature = "wayland")
))]
compile_error!("at least one of the \"x11\"/\"wayland\" features must be enabled");

#[cfg(all(
target_arch = "wasm32",
not(feature = "web-sys"),
not(feature = "stdweb")
))]
compile_error!("at least one of the \"web-sys\"/\"stdweb\" features must be enabled");

fn main() {}
12 changes: 3 additions & 9 deletions examples/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,9 @@ fn main() {
println!("{:?}", event);
match event {
Event::NewEvents(start_cause) => {
wait_cancelled = mode == Mode::WaitUntil;
match start_cause {
StartCause::ResumeTimeReached {
start: _,
requested_resume: _,
} => {
wait_cancelled = false;
}
_ => (),
wait_cancelled = match start_cause {
StartCause::WaitCancelled { .. } => mode == Mode::WaitUntil,
_ => false,
}
}
Event::WindowEvent { event, .. } => match event {
Expand Down
3 changes: 3 additions & 0 deletions src/dpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,16 @@
//! - **Android:** Scale factors are set by the manufacturer to the value that best suits the
//! device, and range from `1.0` to `4.0`. See [this article][android_1] for more information.
//! - **Web:** The scale factor is the ratio between CSS pixels and the physical device pixels.
//! In other words, it is the value of [`window.devicePixelRatio`][web_1]. It is affected by
//! both the screen scaling and the browser zoom level and can go below `1.0`.
//!
//! [points]: https://en.wikipedia.org/wiki/Point_(typography)
//! [picas]: https://en.wikipedia.org/wiki/Pica_(typography)
//! [windows_1]: https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows
//! [apple_1]: https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/Displays/Displays.html
//! [apple_2]: https://developer.apple.com/design/human-interface-guidelines/macos/icons-and-images/image-size-and-resolution/
//! [android_1]: https://developer.android.com/training/multiscreen/screendensities
//! [web_1]: https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio

pub trait Pixel: Copy + Into<f64> {
fn from_f64(f: f64) -> Self;
Expand Down
Loading