update to winit_20. May cause dpi issues. Can't tell yet

macos-click-through
Keith Simmons 5 years ago
parent 86403294a4
commit 29dc2c766b

16
Cargo.lock generated

@ -588,9 +588,9 @@ dependencies = [
[[package]] [[package]]
name = "dispatch" name = "dispatch"
version = "0.1.4" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04e93ca78226c51902d7aa8c12c988338aadd9e85ed9c6be8aaac39192ff3605" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b"
[[package]] [[package]]
name = "dlib" name = "dlib"
@ -2254,8 +2254,8 @@ dependencies = [
[[package]] [[package]]
name = "skulpin" name = "skulpin"
version = "0.5.1" version = "0.6.0"
source = "git+https://github.com/aclysma/skulpin#c0b194833f97b839bd44a30fc2f17851b14e1016" source = "git+https://github.com/aclysma/skulpin?branch=winit_20#ca72c710628c7ff6a86de5c9997dd7443049dc47"
dependencies = [ dependencies = [
"ash", "ash",
"cocoa", "cocoa",
@ -2649,13 +2649,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]] [[package]]
name = "winit" name = "winit"
version = "0.20.0-alpha6" version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/rust-windowing/winit?rev=e295104#e2951041990983eb100dde664607de5330e50b13"
checksum = "bfa4308ca09f50e2f4688c631c36879521bffc39b949238b288ffd932864acbc"
dependencies = [ dependencies = [
"android_glue", "android_glue",
"bitflags", "bitflags",
"calloop",
"cocoa", "cocoa",
"core-foundation", "core-foundation",
"core-graphics", "core-graphics",
@ -2665,6 +2663,8 @@ dependencies = [
"lazy_static", "lazy_static",
"libc", "libc",
"log", "log",
"mio",
"mio-extras",
"objc", "objc",
"parking_lot", "parking_lot",
"percent-encoding", "percent-encoding",

@ -10,7 +10,7 @@ euclid = "0.20.7"
font-kit = "0.4.0" font-kit = "0.4.0"
skribo = { git = "https://github.com/linebender/skribo" } skribo = { git = "https://github.com/linebender/skribo" }
lru = "0.4.3" lru = "0.4.3"
skulpin = { git = "https://github.com/aclysma/skulpin" } skulpin = { git = "https://github.com/aclysma/skulpin", branch="winit_20" }
derive-new = "0.5" derive-new = "0.5"
env_logger = "0.7.1" env_logger = "0.7.1"
rmpv = "0.4.2" rmpv = "0.4.2"

@ -4,7 +4,7 @@ use std::time::{Duration, Instant};
use image::{load_from_memory, GenericImageView, Pixel}; use image::{load_from_memory, GenericImageView, Pixel};
use skulpin::{CoordinateSystem, RendererBuilder, PresentMode}; use skulpin::{CoordinateSystem, RendererBuilder, PresentMode};
use skulpin::skia_safe::icu; use skulpin::skia_safe::icu;
use skulpin::winit::dpi::LogicalSize; use skulpin::winit::dpi::{LogicalSize, PhysicalSize};
use skulpin::winit::event::{ElementState, Event, MouseScrollDelta, StartCause, WindowEvent}; use skulpin::winit::event::{ElementState, Event, MouseScrollDelta, StartCause, WindowEvent};
use skulpin::winit::event_loop::{ControlFlow, EventLoop}; use skulpin::winit::event_loop::{ControlFlow, EventLoop};
use skulpin::winit::window::{Icon, WindowBuilder}; use skulpin::winit::window::{Icon, WindowBuilder};
@ -19,10 +19,10 @@ use crate::INITIAL_DIMENSIONS;
#[folder = "assets/"] #[folder = "assets/"]
struct Asset; struct Asset;
fn handle_new_grid_size(new_size: LogicalSize, renderer: &Renderer) { fn handle_new_grid_size(new_size: PhysicalSize<u32>, renderer: &Renderer) {
if new_size.width > 0.0 && new_size.height > 0.0 { if new_size.width > 0 && new_size.height > 0 {
let new_width = ((new_size.width + 1.0) as f32 / renderer.font_width) as u64; let new_width = ((new_size.width + 1) as f32 / renderer.font_width) as u64;
let new_height = ((new_size.height + 1.0) as f32 / renderer.font_height) as u64; let new_height = ((new_size.height + 1) as f32 / renderer.font_height) as u64;
// Add 1 here to make sure resizing doesn't change the grid size on startup // Add 1 here to make sure resizing doesn't change the grid size on startup
BRIDGE.queue_command(UiCommand::Resize { width: new_width as i64, height: new_height as i64 }); BRIDGE.queue_command(UiCommand::Resize { width: new_width as i64, height: new_height as i64 });
} }

Loading…
Cancel
Save