From 72cd7d9948df279c9509b568cb110a8fedfb1b17 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 13 Jul 2024 11:45:19 +0300 Subject: [PATCH] Switch to glamour instead of euclid --- Cargo.lock | 518 +++++++++++---------- Cargo.toml | 2 +- src/renderer/animation_utils.rs | 12 +- src/renderer/cursor_renderer/cursor_vfx.rs | 6 +- src/renderer/cursor_renderer/mod.rs | 16 +- src/renderer/grid_renderer.rs | 20 +- src/renderer/rendered_window.rs | 27 +- src/settings/window_size.rs | 15 +- src/units.rs | 90 ++-- src/window/mouse_manager.rs | 33 +- src/window/window_wrapper.rs | 21 +- 11 files changed, 411 insertions(+), 349 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 09fcaa681..3a8e93ac8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ab_glyph" -version = "0.2.26" +version = "0.2.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e53b0a3d5760cd2ba9b787ae0c6440ad18ee294ff71b05e3381c900a7d16cfd" +checksum = "79faae4620f45232f599d9bc7b290f88247a0834162c4495ab2f02d60004adfb" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -20,9 +20,9 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -68,7 +68,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" dependencies = [ "android-properties", - "bitflags 2.5.0", + "bitflags 2.6.0", "cc", "cesu8", "jni", @@ -135,9 +135,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -154,9 +154,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" dependencies = [ "backtrace", ] @@ -190,13 +190,13 @@ checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -213,9 +213,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -232,7 +232,7 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cexpr", "clang-sys", "itertools", @@ -245,7 +245,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.64", + "syn 2.0.70", "which 4.4.2", ] @@ -257,9 +257,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block" @@ -294,22 +294,22 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" +checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -340,7 +340,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "log", "polling", "rustix", @@ -362,9 +362,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.97" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "907d8581360765417f8f2e0e7d602733bbed60156b4465b7617243689ef9b83d" dependencies = [ "jobserver", "libc", @@ -416,14 +416,14 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -432,9 +432,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", "clap_derive", @@ -442,9 +442,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", @@ -454,21 +454,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "clipboard-win" @@ -570,27 +570,27 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "csscolorparser" @@ -627,7 +627,7 @@ checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -674,9 +674,9 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "either" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "equivalent" @@ -694,16 +694,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "euclid" -version = "0.22.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f253bc5c813ca05792837a0ff4b3a580336b224512d48f7eda1d7dd9210787" -dependencies = [ - "num-traits", - "serde", -] - [[package]] name = "fdeflate" version = "0.3.4" @@ -746,9 +736,9 @@ dependencies = [ [[package]] name = "flexi_logger" -version = "0.28.0" +version = "0.28.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f248c29a6d4bc5d065c9e9068d858761a0dcd796759f7801cc14db35db23abd8" +checksum = "cca927478b3747ba47f98af6ba0ac0daea4f12d12f55e9104071b3dc00276310" dependencies = [ "chrono", "glob", @@ -758,9 +748,9 @@ dependencies = [ [[package]] name = "font-types" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf6aa1de86490d8e39e04589bd04eb5953cc2a5ef0c25e389e807f44fd24e41" +checksum = "34fd7136aca682873d859ef34494ab1a7d3f57ecd485ed40eb6437ee8c85aa29" dependencies = [ "bytemuck", ] @@ -783,7 +773,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -863,7 +853,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -932,9 +922,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gl" @@ -956,6 +946,30 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "glam" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e05e7e6723e3455f4818c7b26e855439f7546cf617ef669d1adedb8669e5cb9" +dependencies = [ + "approx", + "bytemuck", + "serde", +] + +[[package]] +name = "glamour" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce0d37a206e319849899049d6fe5d386a2cdcbf2efc9b0b1adeb3fabed26152" +dependencies = [ + "approx", + "bytemuck", + "glam", + "num-traits", + "serde", +] + [[package]] name = "glob" version = "0.3.1" @@ -968,7 +982,7 @@ version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18fcd4ae4e86d991ad1300b8f57166e5be0c95ef1f63f3f5b827f8a164548746" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg_aliases", "cgl", "core-foundation", @@ -1037,12 +1051,6 @@ dependencies = [ "allocator-api2", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -1055,6 +1063,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "home" version = "0.5.9" @@ -1250,9 +1264,9 @@ checksum = "10257499f089cd156ad82d0a9cd57d9501fa2c989068992a97eb3c27836f206b" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -1262,18 +1276,18 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.154" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1282,7 +1296,7 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", "redox_syscall 0.4.1", ] @@ -1293,15 +1307,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -1315,9 +1329,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" @@ -1339,9 +1353,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -1360,9 +1374,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", "simd-adler32", @@ -1386,13 +1400,13 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "jni-sys", "log", "ndk-sys", "num_enum", "raw-window-handle 0.5.2", - "raw-window-handle 0.6.1", + "raw-window-handle 0.6.2", "thiserror", ] @@ -1424,10 +1438,10 @@ dependencies = [ "csscolorparser", "derive-new", "dirs", - "euclid", "flexi_logger", "futures 0.3.30", "gl", + "glamour", "glutin", "glutin-winit", "icrate", @@ -1459,7 +1473,7 @@ dependencies = [ "time", "tokio", "tokio-util", - "toml 0.8.13", + "toml 0.8.14", "tracy-client-sys", "unicode-segmentation", "which 6.0.1", @@ -1496,7 +1510,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "crossbeam-channel", "filetime", "fsevent-sys", @@ -1539,9 +1553,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -1608,7 +1622,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -1630,7 +1644,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -1672,9 +1686,9 @@ dependencies = [ [[package]] name = "objc-sys" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da284c198fb9b7b0603f8635185e85fbd5b64ee154b1ed406d489077de2d6d60" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" [[package]] name = "objc2" @@ -1703,9 +1717,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -1733,9 +1747,9 @@ dependencies = [ [[package]] name = "owned_ttf_parser" -version = "0.21.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b41438d2fc63c46c74a2203bf5ccd82c41ba04347b2fcf5754f230b167067d5" +checksum = "490d3a563d3122bf7c911a59b0add9389e5ec0f5f0c3ac6b91ff235a0e6a7f90" dependencies = [ "ttf-parser", ] @@ -1756,9 +1770,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -1772,9 +1786,9 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1819,7 +1833,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -1864,13 +1878,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi", + "hermit-abi 0.4.0", "pin-project-lite", "rustix", "tracing", @@ -1896,7 +1910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -1910,18 +1924,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quick-xml" -version = "0.31.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +checksum = "6f24d770aeca0eacb81ac29dfbc55ebcc09312fdd1f8bbecdc7e4a84e000e3b4" dependencies = [ "memchr", ] @@ -2014,15 +2028,15 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "raw-window-handle" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc3bcbdb1ddfc11e700e62968e6b4cc9c75bb466464ad28fb61c5b2c964418b" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "read-fonts" -version = "0.19.1" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4749db2bd1c853db31a7ae5ee2fc6c30bbddce353ea8fedf673fed187c68c7" +checksum = "e8b8af39d1f23869711ad4cea5e7835a20daa987f80232f7f2a2374d648ca64d" dependencies = [ "bytemuck", "font-types", @@ -2048,11 +2062,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -2068,9 +2082,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", @@ -2080,9 +2094,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -2091,9 +2105,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rmp" @@ -2134,7 +2148,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -2164,9 +2178,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" +checksum = "af947d0ca10a2f3e00c7ec1b515b7c83e5cb3fa62d4c11a64301d9eec54440e9" dependencies = [ "sdd", ] @@ -2191,9 +2205,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sctk-adwaita" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" +checksum = "70b31447ca297092c5a9916fc3b955203157b37c19ca8edde4f52e9843e602c7" dependencies = [ "ab_glyph", "log", @@ -2210,29 +2224,29 @@ checksum = "b84345e4c9bd703274a082fb80caaa99b7612be48dfaa1dd9266577ec412309d" [[package]] name = "serde" -version = "1.0.202" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -2270,7 +2284,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -2309,12 +2323,12 @@ dependencies = [ "bindgen", "cc", "flate2", - "heck 0.5.0", + "heck", "lazy_static", "regex", "serde_json", "tar", - "toml 0.8.13", + "toml 0.8.14", ] [[package]] @@ -2323,12 +2337,22 @@ version = "0.73.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c431cc5c1ca6008199bf2e849083dd05539c9f2a2ffc1c24b521e6e0ef2c31a7" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "skia-bindings", "windows", ] +[[package]] +name = "skrifa" +version = "0.19.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab45fb68b53576a43d4fc0e9ec8ea64e29a4d2cc7f44506964cb75f288222e9" +dependencies = [ + "bytemuck", + "read-fonts", +] + [[package]] name = "slab" version = "0.4.9" @@ -2350,7 +2374,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "calloop", "calloop-wayland-source", "cursor-icon", @@ -2422,33 +2446,33 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] name = "swash" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ec889a8e0a6fcb91041996c8f1f6be0fe1a09e94478785e07c32ce2bca2d2b" +checksum = "4d7773d67fe3373048cf840bfcc54ec3207cfc1e95c526b287ef2eb5eff9faf6" dependencies = [ - "read-fonts", + "skrifa", ] [[package]] @@ -2464,9 +2488,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.64" +version = "2.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ad3dee41f36859875573074334c200d1add8e4a87bb37113ebd31d926b7b11f" +checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" dependencies = [ "proc-macro2", "quote", @@ -2475,9 +2499,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" dependencies = [ "filetime", "libc", @@ -2486,22 +2510,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.60" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.60" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -2562,9 +2586,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes 1.6.0", @@ -2592,13 +2616,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -2626,14 +2650,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.13", + "toml_edit 0.22.15", ] [[package]] @@ -2658,15 +2682,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.8", + "winnow 0.6.13", ] [[package]] @@ -2696,9 +2720,9 @@ dependencies = [ [[package]] name = "ttf-parser" -version = "0.21.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" +checksum = "8686b91785aff82828ed725225925b33b4fde44c4bb15876e5f7c832724c420a" [[package]] name = "typed-path" @@ -2720,9 +2744,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "version_check" @@ -2773,7 +2797,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", "wasm-bindgen-shared", ] @@ -2807,7 +2831,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2820,9 +2844,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wayland-backend" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" +checksum = "269c04f203640d0da2092d1b8d89a2d081714ae3ac2f1b53e99f205740517198" dependencies = [ "cc", "downcast-rs", @@ -2834,11 +2858,11 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.2" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" +checksum = "08bd0f46c069d3382a36c8666c1b9ccef32b8b04f41667ca1fef06a1adcc2982" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "rustix", "wayland-backend", "wayland-scanner", @@ -2850,16 +2874,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cursor-icon", "wayland-backend", ] [[package]] name = "wayland-cursor" -version = "0.31.1" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" +checksum = "09414bcf0fd8d9577d73e9ac4659ebc45bcc9cff1980a350543ad8e50ee263b2" dependencies = [ "rustix", "wayland-client", @@ -2872,7 +2896,7 @@ version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -2884,7 +2908,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -2897,7 +2921,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -2906,9 +2930,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.1" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" +checksum = "edf466fc49a4feb65a511ca403fec3601494d0dee85dbf37fff6fa0dd4eec3b6" dependencies = [ "proc-macro2", "quick-xml", @@ -2917,9 +2941,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.31.1" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +checksum = "4a6754825230fa5b27bafaa28c30b3c9e72c55530581220cef401fa422c0fae7" dependencies = [ "dlib", "log", @@ -3009,7 +3033,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ "windows-core 0.56.0", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3018,7 +3042,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3030,7 +3054,7 @@ dependencies = [ "windows-implement", "windows-interface", "windows-result", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3041,7 +3065,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] @@ -3052,26 +3076,26 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] [[package]] name = "windows-registry" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f721bc2e55efb506a1a395a545cb76c2481fb023d33b51f0050e7888716281cf" +checksum = "acc134c90a0318d873ec962b13149e9c862ff0d2669082a709a4810167a3c6ee" dependencies = [ "windows-result", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] name = "windows-result" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3098,7 +3122,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3133,18 +3157,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3161,9 +3185,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3179,9 +3203,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3197,15 +3221,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3221,9 +3245,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3239,9 +3263,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3257,9 +3281,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3275,9 +3299,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" @@ -3288,7 +3312,7 @@ dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.5.0", + "bitflags 2.6.0", "bytemuck", "calloop", "cfg_aliases", @@ -3307,7 +3331,7 @@ dependencies = [ "orbclient", "percent-encoding", "raw-window-handle 0.5.2", - "raw-window-handle 0.6.1", + "raw-window-handle 0.6.2", "redox_syscall 0.3.5", "rustix", "sctk-adwaita", @@ -3340,9 +3364,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -3442,7 +3466,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "dlib", "log", "once_cell", @@ -3451,9 +3475,9 @@ dependencies = [ [[package]] name = "xkeysym" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "xml-rs" @@ -3463,20 +3487,20 @@ checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.70", ] diff --git a/Cargo.toml b/Cargo.toml index 1b8de500a..3c9cd3f05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ copypasta = "0.10.1" csscolorparser = "0.6.2" derive-new = "0.6.0" dirs = "5.0.0" -euclid = { version = "0.22.9", features = ["serde"] } +glamour = { version = "0.11.1", features = ["serde"] } flexi_logger = { version = "0.28.0", default-features = false } futures = "0.3.21" gl = "0.14.0" diff --git a/src/renderer/animation_utils.rs b/src/renderer/animation_utils.rs index 8f1edfcf7..7d658c99e 100644 --- a/src/renderer/animation_utils.rs +++ b/src/renderer/animation_utils.rs @@ -1,4 +1,4 @@ -use crate::units::PixelPos; +use glamour::{Point2, Unit}; #[allow(dead_code)] pub fn ease_linear(t: f32) -> f32 { @@ -73,13 +73,13 @@ pub fn ease(ease_func: fn(f32) -> f32, start: f32, end: f32, t: f32) -> f32 { lerp(start, end, ease_func(t)) } -pub fn ease_point( +pub fn ease_point>( ease_func: fn(f32) -> f32, - start: PixelPos, - end: PixelPos, + start: Point2, + end: Point2, t: f32, -) -> PixelPos { - PixelPos::new( +) -> Point2 { + Point2::new( ease(ease_func, start.x, end.x, t), ease(ease_func, start.y, end.y, t), ) diff --git a/src/renderer/cursor_renderer/cursor_vfx.rs b/src/renderer/cursor_renderer/cursor_vfx.rs index fa22b5bed..380d3ab0b 100644 --- a/src/renderer/cursor_renderer/cursor_vfx.rs +++ b/src/renderer/cursor_renderer/cursor_vfx.rs @@ -7,7 +7,7 @@ use crate::{ renderer::cursor_renderer::CursorSettings, renderer::{animation_utils::*, grid_renderer::GridRenderer}, settings::*, - units::{PixelPos, PixelSize, PixelVec}, + units::{GridSize, PixelPos, PixelSize, PixelVec}, }; pub trait CursorVfx { @@ -149,7 +149,7 @@ impl CursorVfx for PointHighlight { paint.set_color(color); - let cursor_height = grid_renderer.grid_scale.0.height; + let cursor_height = grid_renderer.grid_scale.height(); let size = 3.0 * cursor_height; let radius = self.t * size; let hr = radius * 0.5; @@ -335,7 +335,7 @@ impl CursorVfx for ParticleTrail { cursor: &Cursor, ) { let mut paint = Paint::new(skia_safe::colors::WHITE, None); - let font_dimensions = grid_renderer.grid_scale.0; + let font_dimensions = GridSize::new(1.0, 1.0) * grid_renderer.grid_scale; match self.trail_mode { TrailMode::Torpedo | TrailMode::Railgun => { paint.set_style(Style::Stroke); diff --git a/src/renderer/cursor_renderer/mod.rs b/src/renderer/cursor_renderer/mod.rs index 8f86d22d8..e2cda45fb 100644 --- a/src/renderer/cursor_renderer/mod.rs +++ b/src/renderer/cursor_renderer/mod.rs @@ -79,9 +79,9 @@ pub struct Corner { impl Corner { pub fn new() -> Corner { Corner { - start_position: PixelPos::origin(), - current_position: PixelPos::origin(), - relative_position: GridPos::::origin(), + start_position: PixelPos::default(), + current_position: PixelPos::default(), + relative_position: GridPos::::default(), previous_destination: PixelPos::new(-1000.0, -1000.0), length_multiplier: 1.0, t: 0.0, @@ -134,7 +134,7 @@ impl Corner { d.normalize() }; - let corner_direction = self.relative_position.to_vector().normalize().cast_unit(); + let corner_direction = self.relative_position.as_vector().normalize().cast(); let direction_alignment = travel_direction.dot(corner_direction); @@ -352,12 +352,12 @@ impl CursorRenderer { self.previous_vfx_mode = settings.vfx_mode.clone(); } - let mut cursor_width = grid_renderer.grid_scale.0.width; + let mut cursor_width = grid_renderer.grid_scale.width(); if self.cursor.double_width && self.cursor.shape == CursorShape::Block { cursor_width *= 2.0; } - let cursor_dimensions = PixelSize::new(cursor_width, grid_renderer.grid_scale.0.height); + let cursor_dimensions = PixelSize::new(cursor_width, grid_renderer.grid_scale.height()); let in_insert_mode = matches!(current_mode, EditorMode::Insert); @@ -382,13 +382,13 @@ impl CursorRenderer { let mut animating = false; - if center_destination != PixelPos::origin() { + if center_destination != PixelPos::ZERO { let immediate_movement = !settings.animate_in_insert_mode && in_insert_mode || !settings.animate_command_line && !changed_to_from_cmdline; for corner in self.corners.iter_mut() { let corner_animating = corner.update( &settings, - GridScale(cursor_dimensions), + GridScale::new(cursor_dimensions), center_destination, dt, immediate_movement, diff --git a/src/renderer/grid_renderer.rs b/src/renderer/grid_renderer.rs index d36be5a72..a9672484e 100644 --- a/src/renderer/grid_renderer.rs +++ b/src/renderer/grid_renderer.rs @@ -46,7 +46,7 @@ impl GridRenderer { shaper, default_style, em_size, - grid_scale: GridScale(font_dimensions), + grid_scale: GridScale::new(font_dimensions), is_ready: false, } } @@ -77,14 +77,14 @@ impl GridRenderer { fn update_font_dimensions(&mut self) { self.em_size = self.shaper.current_size(); - self.grid_scale = GridScale(self.shaper.font_base_dimensions()); + self.grid_scale = GridScale::new(self.shaper.font_base_dimensions()); self.is_ready = true; - trace!("Updated font dimensions: {:?}", self.grid_scale.0); + trace!("Updated font dimensions: {:?}", self.grid_scale); } fn compute_text_region(&self, grid_position: GridPos, cell_width: i32) -> PixelRect { - let pos = grid_position.cast() * self.grid_scale; - let size = GridSize::new(cell_width, 1).cast() * self.grid_scale; + let pos = grid_position * self.grid_scale; + let size = GridSize::new(cell_width, 1) * self.grid_scale; PixelRect::from_origin_and_size(pos, size) } @@ -151,8 +151,8 @@ impl GridRenderer { style: &Option>, ) -> bool { tracy_zone!("draw_foreground"); - let pos = grid_position.cast() * self.grid_scale; - let size = GridSize::new(cell_width, 0).cast() * self.grid_scale; + let pos = grid_position * self.grid_scale; + let size = GridSize::new(cell_width, 0) * self.grid_scale; let width = size.width; let style = style.as_ref().unwrap_or(&self.default_style); @@ -164,7 +164,7 @@ impl GridRenderer { let region = self.compute_text_region(clip_position, cell_width + 2); if let Some(underline_style) = style.underline { - let line_position = self.grid_scale.0.height - self.shaper.underline_position(); + let line_position = self.grid_scale.height() - self.shaper.underline_position(); let p1 = pos + PixelVec::new(0.0, line_position); let p2 = pos + PixelVec::new(width, line_position); @@ -195,7 +195,7 @@ impl GridRenderer { let leading_spaces = text[..leading_space_bytes].chars().count(); let trimmed = trimmed.trim_end(); let adjustment = PixelVec::new( - leading_spaces as f32 * self.grid_scale.0.width, + leading_spaces as f32 * self.grid_scale.width(), self.shaper.y_adjustment(), ); @@ -272,7 +272,7 @@ impl GridRenderer { path.move_to(p1); let mut i = p1.0; let mut sin = -2. * stroke_width; - let increment = self.grid_scale.0.width / 2.; + let increment = self.grid_scale.width() / 2.; while i < p2.0 { sin *= -1.; i += increment; diff --git a/src/renderer/rendered_window.rs b/src/renderer/rendered_window.rs index 7f481afc3..92b3c091f 100644 --- a/src/renderer/rendered_window.rs +++ b/src/renderer/rendered_window.rs @@ -141,9 +141,9 @@ impl RenderedWindow { scroll_delta: 0, viewport_margins: ViewportMargins { top: 0, bottom: 0 }, - grid_start_position: grid_position.cast(), - grid_current_position: grid_position.cast(), - grid_destination: grid_position.cast(), + grid_start_position: grid_position.try_cast().unwrap(), + grid_current_position: grid_position.try_cast().unwrap(), + grid_destination: grid_position.try_cast().unwrap(), position_t: 2.0, // 2.0 is out of the 0.0 to 1.0 range and stops animation. scroll_animation: CriticallyDampedSpringAnimation::new(), @@ -153,8 +153,10 @@ impl RenderedWindow { } pub fn pixel_region(&self, grid_scale: GridScale) -> PixelRect { - GridRect::::from_origin_and_size(self.grid_current_position, self.grid_size.cast()) - * grid_scale + GridRect::::from_origin_and_size( + self.grid_current_position, + self.grid_size.try_cast().unwrap(), + ) * grid_scale } pub fn update_blend(&self, blend: u8) { @@ -171,7 +173,7 @@ impl RenderedWindow { return destination; } - let mut grid_size: GridSize = self.grid_size.cast(); + let mut grid_size: GridSize = self.grid_size.try_cast().unwrap(); if matches!(self.window_type, WindowType::Message { .. }) { // The message grid size is always the full window size, so use the relative position to @@ -214,11 +216,10 @@ impl RenderedWindow { let prev_position = self.grid_current_position; self.grid_current_position = ease_point( ease_out_expo, - self.grid_start_position.cast_unit(), - self.get_target_position(grid_rect).cast_unit(), + self.grid_start_position, + self.get_target_position(grid_rect), self.position_t, - ) - .cast_unit(); + ); animating |= self.grid_current_position != prev_position; let scrolling = self @@ -607,7 +608,7 @@ impl RenderedWindow { ) -> impl Iterator>)> { let scroll_offset_lines = self.scroll_animation.position.floor(); let scroll_offset = scroll_offset_lines - self.scroll_animation.position; - let scroll_offset_pixels = (scroll_offset * grid_scale.0.height).round(); + let scroll_offset_pixels = (scroll_offset * grid_scale.height()).round(); self.iter_scrollable_lines().map(move |(i, line)| { let mut matrix = Matrix::new_identity(); @@ -615,7 +616,7 @@ impl RenderedWindow { pixel_region.min.x, pixel_region.min.y + (scroll_offset_pixels - + ((i + self.viewport_margins.top as isize) as f32 * grid_scale.0.height)), + + ((i + self.viewport_margins.top as isize) as f32 * grid_scale.height())), )); (matrix, line) }) @@ -687,7 +688,7 @@ impl RenderedWindow { let mut recorder = PictureRecorder::new(); - let line_size = GridSize::new(self.grid_size.width, 1).cast() * grid_scale; + let line_size = GridSize::new(self.grid_size.width, 1) * grid_scale; let grid_rect = Rect::from_wh(line_size.width, line_size.height); let canvas = recorder.begin_recording(grid_rect, None); diff --git a/src/settings/window_size.rs b/src/settings/window_size.rs index 326b87819..554cf4343 100644 --- a/src/settings/window_size.rs +++ b/src/settings/window_size.rs @@ -9,9 +9,18 @@ use crate::{ const SETTINGS_FILE: &str = "neovide-settings.json"; -pub const DEFAULT_GRID_SIZE: GridSize = GridSize::new(100, 50); -pub const MIN_GRID_SIZE: GridSize = GridSize::new(20, 6); -pub const MAX_GRID_SIZE: GridSize = GridSize::new(10000, 1000); +pub const DEFAULT_GRID_SIZE: GridSize = GridSize { + width: 100, + height: 50, +}; +pub const MIN_GRID_SIZE: GridSize = GridSize { + width: 20, + height: 6, +}; +pub const MAX_GRID_SIZE: GridSize = GridSize { + width: 10000, + height: 1000, +}; #[derive(Serialize, Deserialize, Debug)] pub enum PersistentWindowSettings { diff --git a/src/units.rs b/src/units.rs index 47dc01d2b..724d7a30c 100644 --- a/src/units.rs +++ b/src/units.rs @@ -1,23 +1,38 @@ -use std::ops::{Div, Mul}; +use std::{ + fmt::Debug, + marker::PhantomData, + ops::{Div, Mul}, +}; -use euclid::{Box2D, Point2D, Size2D, Vector2D}; +use glamour::{Box2, Point2, Scalar, Size2, Transform2, TransformMap, Unit, Vector2}; /// Coordinates in grid units (multiplies of the font size) -pub struct Grid; +pub struct Grid { + phantom: PhantomData, +} + +impl Unit for Grid { + type Scalar = T; +} /// Coordinates in pixel units -pub struct Pixel; +pub struct Pixel { + phantom: PhantomData, +} +impl Unit for Pixel { + type Scalar = T; +} -pub type GridVec = Vector2D; -pub type PixelVec = Vector2D; +pub type GridVec = Vector2>; +pub type PixelVec = Vector2>; -pub type GridSize = Size2D; -pub type PixelSize = Size2D; +pub type GridSize = Size2>; +pub type PixelSize = Size2>; -pub type GridPos = Point2D; -pub type PixelPos = Point2D; +pub type GridPos = Point2>; +pub type PixelPos = Point2>; -pub type GridRect = Box2D; -pub type PixelRect = Box2D; +pub type GridRect = Box2>; +pub type PixelRect = Box2>; pub fn to_skia_point(pos: PixelPos) -> skia_safe::Point { skia_safe::Point::new(pos.x, pos.y) @@ -32,88 +47,97 @@ pub fn to_skia_rect(rect: &PixelRect) -> skia_safe::Rect { } } -// The Euclid library doesn't support two dimensional scales, so make our own simplified one -#[derive(Copy, Clone)] -pub struct GridScale(pub PixelSize); +#[derive(Copy, Clone, Debug)] +pub struct GridScale { + transform: Transform2, Pixel>, +} impl GridScale { + pub fn new(scale: PixelSize) -> Self { + Self { + transform: Transform2::from_scale(scale.as_vector().cast()), + } + } + pub fn height(&self) -> f32 { - self.0.height + self.transform.matrix.y_axis.y } pub fn width(&self) -> f32 { - self.0.width + self.transform.matrix.x_axis.x } } -impl Mul for GridVec { +impl Mul for GridVec { type Output = PixelVec; #[inline] fn mul(self, scale: GridScale) -> Self::Output { - Self::Output::new(self.x * scale.0.width, self.y * scale.0.height) + let grid_vec: GridVec = self.try_cast().unwrap(); + scale.transform.map(grid_vec) } } -impl Mul for GridSize { +impl Mul for GridSize { type Output = PixelSize; #[inline] fn mul(self, scale: GridScale) -> Self::Output { - Self::Output::new(self.width * scale.0.width, self.height * scale.0.height) + (*self.as_vector() * scale).to_size() } } -impl Mul for GridPos { +impl Mul for GridPos { type Output = PixelPos; #[inline] fn mul(self, scale: GridScale) -> Self::Output { - Self::Output::new(self.x * scale.0.width, self.y * scale.0.height) + (*self.as_vector() * scale).to_point() } } -impl Mul for GridRect { +impl Mul for GridRect { type Output = PixelRect; #[inline] fn mul(self, scale: GridScale) -> Self::Output { - Self::Output::new(self.min * scale, self.max * scale) + PixelRect::new(*self.min.as_vector() * scale, *self.max.as_vector() * scale) } } -impl Div for PixelVec { +impl Div for PixelVec { type Output = GridVec; #[inline] fn div(self, scale: GridScale) -> Self::Output { - Self::Output::new(self.x / scale.0.width, self.y / scale.0.height) + let pixel_vec: PixelVec = self.try_cast().unwrap(); + scale.transform.inverse().map(pixel_vec) } } -impl Div for PixelSize { +impl Div for PixelSize { type Output = GridSize; #[inline] fn div(self, scale: GridScale) -> Self::Output { - Self::Output::new(self.width / scale.0.width, self.height / scale.0.height) + (*self.as_vector() / scale).to_size() } } -impl Div for PixelPos { +impl Div for PixelPos { type Output = GridPos; #[inline] fn div(self, scale: GridScale) -> Self::Output { - Self::Output::new(self.x / scale.0.width, self.y / scale.0.height) + (*self.as_vector() / scale).to_point() } } -impl Div for PixelRect { +impl Div for PixelRect { type Output = GridRect; #[inline] fn div(self, scale: GridScale) -> Self::Output { - Self::Output::new(self.min / scale, self.max / scale) + GridRect::new(*self.min.as_vector() / scale, *self.max.as_vector() / scale) } } diff --git a/src/window/mouse_manager.rs b/src/window/mouse_manager.rs index 0ea869958..a42840158 100644 --- a/src/window/mouse_manager.rs +++ b/src/window/mouse_manager.rs @@ -12,6 +12,8 @@ use winit::{ window::Window, }; +use glamour::Contains; + use crate::{ bridge::{send_ui, SerialCommand}, renderer::{Renderer, WindowDrawDetails}, @@ -27,9 +29,9 @@ fn clamp_position( grid_scale: GridScale, ) -> PixelPos { let min = region.min; - let max = region.max - grid_scale.0; + let max = region.max - GridPos::new(1.0, 1.0) * grid_scale; - position.clamp(min, max) + position.clamp(min, max.into()) } fn mouse_button_to_button_text(mouse_button: MouseButton) -> Option { @@ -84,9 +86,9 @@ impl MouseManager { MouseManager { drag_details: None, has_moved: false, - window_position: PixelPos::origin(), - grid_position: GridPos::origin(), - scroll_position: GridPos::::origin(), + window_position: PixelPos::default(), + grid_position: GridPos::default(), + scroll_position: GridPos::default(), touch_position: HashMap::new(), mouse_hidden: false, enabled: true, @@ -104,7 +106,7 @@ impl MouseManager { editor_state .window_regions .iter() - .filter(|details| details.region.contains(position)) + .filter(|details| details.region.contains(&position)) .last() } @@ -123,14 +125,15 @@ impl MouseManager { (relative_position / *editor_state.grid_scale) .floor() - .cast() + .try_cast() + .unwrap() } fn handle_pointer_motion(&mut self, position: PixelPos, editor_state: &EditorState) { let window_size = editor_state.window.inner_size(); let window_size = PixelSize::new(window_size.width as f32, window_size.height as f32); let relative_window_rect = PixelRect::from_size(window_size); - if !relative_window_rect.contains(position) { + if !relative_window_rect.contains(&position) { return; } @@ -159,7 +162,7 @@ impl MouseManager { send_ui(SerialCommand::Drag { button: mouse_button_to_button_text(drag_details.button).unwrap(), grid_id: window_details.event_grid_id(), - position: self.grid_position.try_cast().unwrap().to_tuple(), + position: self.grid_position.try_cast::().unwrap().to_tuple(), modifier_string: editor_state .keyboard_manager .format_modifier_string("", true), @@ -170,7 +173,7 @@ impl MouseManager { button: "move".into(), action: "".into(), // this is ignored by nvim grid_id: window_details.event_grid_id(), - position: relative_position.try_cast().unwrap().to_tuple(), + position: relative_position.try_cast::().unwrap().to_tuple(), modifier_string: editor_state .keyboard_manager .format_modifier_string("", true), @@ -210,7 +213,7 @@ impl MouseManager { button: button_text.clone(), action, grid_id: details.event_grid_id(), - position: position.try_cast().unwrap().to_tuple(), + position: position.try_cast::().unwrap().to_tuple(), modifier_string: editor_state .keyboard_manager .format_modifier_string("", true), @@ -243,9 +246,9 @@ impl MouseManager { let draw_details = self.get_window_details_under_mouse(editor_state); let grid_id = draw_details.map(|details| details.id).unwrap_or(0); - let previous: GridPos = self.scroll_position.floor().cast().cast_unit(); + let previous: GridPos = self.scroll_position.floor().try_cast().unwrap(); self.scroll_position += amount; - let new: GridPos = self.scroll_position.floor().cast().cast_unit(); + let new: GridPos = self.scroll_position.floor().try_cast().unwrap(); let vertical_input_type = match new.y.partial_cmp(&previous.y) { Some(Ordering::Greater) => Some("up"), @@ -257,7 +260,7 @@ impl MouseManager { let scroll_command = SerialCommand::Scroll { direction: input_type.to_string(), grid_id, - position: self.grid_position.try_cast().unwrap().to_tuple(), + position: self.grid_position.try_cast::().unwrap().to_tuple(), modifier_string: editor_state .keyboard_manager .format_modifier_string("", true), @@ -277,7 +280,7 @@ impl MouseManager { let scroll_command = SerialCommand::Scroll { direction: input_type.to_string(), grid_id, - position: self.grid_position.try_cast().unwrap().to_tuple(), + position: self.grid_position.try_cast::().unwrap().to_tuple(), modifier_string: editor_state .keyboard_manager .format_modifier_string("", true), diff --git a/src/window/window_wrapper.rs b/src/window/window_wrapper.rs index 45f73c975..7dc524ecd 100644 --- a/src/window/window_wrapper.rs +++ b/src/window/window_wrapper.rs @@ -105,7 +105,7 @@ impl WinitWindowWrapper { log::info!( "window created (scale_factor: {:.4}, font_dimensions: {:?})", scale_factor, - renderer.grid_renderer.grid_scale.0, + renderer.grid_renderer.grid_scale, ); let WindowSettings { @@ -464,7 +464,7 @@ impl WinitWindowWrapper { let res = self .renderer - .animate_frame(&self.get_grid_rect_from_window(GridSize::zero()).cast(), dt); + .animate_frame(&self.get_grid_rect_from_window(GridSize::default()), dt); tracy_plot!("animate_frame", res as u8 as f64); self.renderer.prepare_lines(false); #[allow(clippy::let_and_return)] @@ -594,10 +594,10 @@ impl WinitWindowWrapper { ), )); - let new_size = (grid_size.cast() * self.renderer.grid_renderer.grid_scale) + let new_size = (grid_size * self.renderer.grid_renderer.grid_scale) .floor() - .cast() - .cast_unit() + .try_cast() + .unwrap() + window_padding_size; log::info!( @@ -623,15 +623,16 @@ impl WinitWindowWrapper { PixelSize::new(self.saved_inner_size.width, self.saved_inner_size.height) - window_padding_size; - let grid_size = (content_size.cast() / self.renderer.grid_renderer.grid_scale) + let grid_size = (content_size / self.renderer.grid_renderer.grid_scale) .floor() - .cast(); + .try_cast() + .unwrap(); grid_size.max(min) } fn get_grid_rect_from_window(&self, min: GridSize) -> GridRect { - let size = self.get_grid_size_from_window(min).cast(); + let size = self.get_grid_size_from_window(min).try_cast().unwrap(); let pos = PixelPos::new(self.window_padding.left, self.window_padding.top).cast() / self.renderer.grid_renderer.grid_scale; GridRect::::from_origin_and_size(pos, size) @@ -658,10 +659,10 @@ impl WinitWindowWrapper { fn update_ime_position(&mut self) { let grid_scale = self.renderer.grid_renderer.grid_scale; - let font_dimensions = grid_scale.0; + let font_dimensions = GridSize::new(1.0, 1.0) * grid_scale; let mut position = self.renderer.get_cursor_destination(); position.y += font_dimensions.height; - let position: GridPos = (position / grid_scale).floor().cast(); + let position: GridPos = (position / grid_scale).floor().try_cast().unwrap(); let position = dpi::PhysicalPosition { x: position.x, y: position.y,