1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

check passed

This commit is contained in:
adrien
2025-11-07 11:11:07 +01:00
parent 2df6154d9d
commit daccad61cd
80 changed files with 186 additions and 267 deletions

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@
/.vscode
/media/*
.idea/
/scripts/check.sh

View File

@@ -2600,8 +2600,8 @@ impl Widget for &mut Margin {
} else {
// Make sure it is not same:
if self.is_same() {
if self.right == i16::MAX {
self.right = i16::MAX - 1;
if self.right == i8::MAX {
self.right = i8::MAX - 1;
} else {
self.right += 1;
}

View File

@@ -9,8 +9,10 @@ use crate::{
pub struct TextVisuals {
/// Font used
pub font_id: FontId,
/// Font color
pub color: Color32,
/// Text decoration
pub underline: Stroke,
pub strikethrough: Stroke,
@@ -33,14 +35,19 @@ pub struct ButtonStyle {
pub struct CheckboxStyle {
/// Frame around
pub frame: Frame,
/// Text next to it
pub text: TextVisuals,
/// Checkbox size
pub size: f32,
/// Checkmark size
pub check_size: f32,
/// Frame of the checkbox itself
pub checkbox_frame: Frame,
/// Checkmark stroke
pub stroke: Stroke,
}
@@ -48,8 +55,10 @@ pub struct CheckboxStyle {
pub struct LabelStyle {
/// Frame around
pub frame: Frame,
/// Text style
pub text: TextVisuals,
/// Wrap mode used
pub wrap_mode: TextWrapMode,
}
@@ -57,6 +66,7 @@ pub struct LabelStyle {
pub struct SeparatorStyle {
/// How much space is allocated in the layout direction
pub spacing: f32,
/// How to paint it
pub stroke: Stroke,
}

View File

@@ -323,10 +323,10 @@ impl<'a> Button<'a> {
}
frame = frame.inner_margin(Margin {
left: button_padding.left - frame.stroke.width as i16,
top: button_padding.top - frame.stroke.width as i16,
right: button_padding.right - frame.stroke.width as i16,
bottom: button_padding.bottom - frame.stroke.width as i16,
left: button_padding.left - frame.stroke.width as i8,
top: button_padding.top - frame.stroke.width as i8,
right: button_padding.right - frame.stroke.width as i8,
bottom: button_padding.bottom - frame.stroke.width as i8,
});
// Apply the correct font and color if Text

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:44a68dc4d3aeebeb2d296c5c8e03aac330e1e4552364084347b710326c88f70c
size 335794
oid sha256:7ea2f4e2fc86a3b5a612448d79589df8f5432d8891241541bba2135d80137ef0
size 335919

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e9a760fe4a695e6321f00e40bfa76fd0195bee7157a1217572765e3f146ea2cc
size 93640
oid sha256:c79323e08a7027699082689194570c9b6c738d4b4d7d227ec4421bed028a12fa
size 93808

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a1670bbfc1f0a71e20cbbeb73625c148b680963bc503d9b48e9cc43e704d7c54
size 181671
oid sha256:236e36cc1ae7f0b6564536e466a0d7992333254c6fd0853e85531895697fd996
size 181936

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dc9c22567b76193a7f6753c4217adb3c92afa921c488ba1cf2e14b403814e7ac
size 99841
oid sha256:8b6566e6aae8f551adbd4f6efbf861ed59d467ec158cf28ada39177911f4b302
size 100505

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cb944eca56724f6a2106ea8db2043dc94c0ea40bdd4cdeb0e520790f97cc9598
size 27049
oid sha256:91823881c5d74838d2aea59e1b93a472d2133a184a1f98c9771919a5af4fd19f
size 27138

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c1951b99908326b3f05ebb72aa4d02d0f297bdd925f38ded09041fae45400c1
size 85217
oid sha256:40f6059fb76d24f418d6808732a0887ec9d90f7da0be746a5ec077d2f2c0066b
size 85185

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0df751bac5947c9bf6f82d075cf5670a562742b80d6c512bcd642da5ed449d26
size 25975
oid sha256:5f003032015dc8330f4bf5f334482b4a10fa8a25743e265ddbc5c47ff56723ff
size 26027

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1227636b03a7d35db3482b19f6059ec7aaf03ca795edadd5338056be6f6a8f7f
size 126724
oid sha256:a87f318f97d124b2033acf58b6f32e46e3aed018ce7705a6662681885d55e3b9
size 126756

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c01e96bf0aab24dbcfc05f2a6dcb0ffcddff69ec2474797de4fbce0a0670a8cd
size 24964
oid sha256:0dc7d0fc29e216e97a3a39250b40790c4e300b17a39be11674215797a471663a
size 25024

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ec357eafd145194f99c36a53a149a8b331fd691c5088df43ee96282b84bc81a4
size 99439
oid sha256:79b95e5b17c03b2301ab42b25ad6911ef5b536c8ecea23350e2973a46e803bdb
size 99707

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e1378d865af3df02e12a0c4bc087620a4e9ef0029221db3180cdd2fd34f69d7f
size 24832
oid sha256:c97e448603f69a413fe12f955c1e64eee8eb4700ee6e8eea1202ede9558bfd94
size 24881

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:aff927596be5db77349ec0bbdcc852a0b1467e94c2a553a740a383ae318bad18
size 51670
oid sha256:a83b1f5f2ce1751e8288a2c33a46fa541cd28b2d1eb4ccefeaef4224b0be2f88
size 51859

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad26106a86a6236f0db1c51bed754b370530813e9bb6e36c1be2948820fbef25
size 47827
oid sha256:28f191a4ee646fc63e19ac435316fd790103221e3055da9979fce04c4f617c79
size 48041

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bf7f0a76424a959ede7afbb0eaf777638038cc6fe208ef710d9d82638d68b4d0
size 37848
oid sha256:744bfd9c1f714beedaf6cc3c9f5fed1aaeef0d8c8a5521fb09e419079140df35
size 37922

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2d2370972781f15a1d602deca28bca38f1c077152801870edf2112650b8b1349
size 17708
oid sha256:c2449a12444f730d45b6e2856fd878d6b47a0eae56e53576a5899e61e2bd9c15
size 17680

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c91f592571ba654d0a96791662ae7530a1db4c1630b57c795d1c006ea6e46f19
size 256975
oid sha256:4b5998d173ac2c2ebf64ad8c2c4f98463b344a47874b9a390709e639f0fe2a62
size 257487

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f8b937a8a63de6fedcd0f9748b1d04cd863331a297bec78906885a0107def32a
size 61242
oid sha256:4237a914a0a57957d54020e496043305fe26438dbd4f03db15e9db43b471ccc8
size 61322

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2855bd95ab33b5232edada1f65684bbba2748025b6b64eb9ac68a5f2d10ad4bd
size 34491
oid sha256:31ebde2103ea2c30320f95e7ee9a6960feaf3946ad3b6db0da0bbcc5f85fa89b
size 34646

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be599ae66323140bba4a7d63546acbf84340b57e2d82d4736bf3fe590040319d
size 23623
oid sha256:96d5160a8e70480ac063be67481d890ddd17a929b1a6e8455e6e2568910eaa01
size 23679

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:01c3cb5e8972e0cab5325328f93af8f51b35a0d61016e74969eab0f7ddea1e02
size 176973
oid sha256:f2b02e997183f30bdd7a53afb92cee9e91c205e2ad2f77db7781177c2f20e166
size 168401

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f2f6cedc262259d52c1fbf4283d99b4b62ec732e8688b1e2799a2581425e0564
size 120342
oid sha256:25186c248e415becbbf00c90fad969f5b290683e1b3ffe25c07854330dbce999
size 120914

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4fbcca2b13c94769a62b44853b19f7e841bbb60c9197b3d0bf6e83ef9f8f76d1
size 77815
oid sha256:f95f41ced0ec7831acfb1257502b3d2617576b9d5002c7a30859a1150b4604cd
size 82431

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cc24f146adf0282cfb51723b56c76eceb92f2988fc67bbeefd16b93950505922
size 70110
oid sha256:d441f831d6ac99090756b8cadf13bc22ce11f8cc8aea9edced5c20b4578b71a8
size 70273

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:77aeaa1dcd391a571cb38732686e0b85b2d727975c02507a114d4e932f2c351b
size 65562
oid sha256:4b6e31294f9933c1788eb5a4636042378610ac1756dbac26c25792fe0a4e7ba1
size 66108

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:415b1ce17dd6df7ca7a86fed92750c2ef811ff64720a447ae3ca6be10090666e
size 64624
oid sha256:3bdedaa57fcbd0b082000d47b43f75983171ee6ed7b7370a2092c39964d31309
size 64906

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0eaf717bf0083737c4186ac39e7baf98f42fffb36b49434a6658eff1430a0ac6
size 13187
oid sha256:a622b6945028e019061fdcf5e6f303fe647e08b2b781ac5ce7eb6fc21bc41e7a
size 13190

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a31f0c12bb70449136443f9086103bd5b46356eedc2bb93ae1b6b10684ab69ca
size 36285
oid sha256:b3ef5e5bdf4859a295212a17b879884f707e0c48e4a158bbe50961035af1408e
size 36410

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b85a2af24c3361a0008fd0996e8d7244dc3e289646ec7233e8bad39a586c871c
size 44512
oid sha256:4d100a7932f71b02732e454be4bcc9e634a0fc45be0aa4ecff8aefb148ab2f38
size 44526

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:60a44771c6bc9236593717236f9eca40bcb4723bac7567493cab4326f003eba3
size 48693
oid sha256:25c600764907b9a4e885939b3c5967ca67aa669f5ad2c30e02943bc97ca4cb87
size 48884

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:53c1509f7be264ed2947cd4ec0f10b555e9f710e949ed6fd8a73ca8ade53abd4
size 48570
oid sha256:831268ea2718a60e1142c98fd53c2530a25dd0bd2ededfbf3a5c213da0c72d8a
size 48751

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:20eecafb998f69c2384afabc27eec1f97f413d603ece944adae9a99139be0b58
size 44689
oid sha256:9147bbd560474269a2294fab2df54d61ccf3eee0ae453e710fd8034d0f709232
size 44865

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f9980486c36a0242f3b043a172c411d4fc9573543d3cd7c1c43bf020c18868a9
size 619816
oid sha256:0f38b9859a1b272a6eeee71ce186a1ecaf245efd954ec5012a0c15236a530b6c
size 622678

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:040e2e486ae4773a084da99513a53c620e8e2bba215183ec26c6e489381d6254
size 823086
oid sha256:8c4e677d8baf46bff20171ea9488ff36ff3d1d367355232c85b0bd1aa2e26009
size 824364

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:439a5f942a5f05b9c09685ef90be94c150a21a68d1d235af22372b9b6a7b7389
size 1035734
oid sha256:6fd3a2ae4ff90181e80c595f82f748cf333e829012bbf69fe65565ef10102006
size 1038859

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9b7d7e290b97a8042af3af3cd9ceb274950cf607dd7e9cd6c71d5a113d3b57a5
size 1206155
oid sha256:be318246896430d1ccadcdbd49ce1f1b55656fc43f0df8468c96e8e8bd0186c6
size 1210243

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fedd5546e36a89121c0bb0a780b0bbe081611c2c04013064872801181503fb83
size 1231599
oid sha256:e8a595e9a1d0671c094aa204352a93bb35732bffdf73d2cf266baa860429d955
size 1235525

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:69a7040336fc92c6d7b158283aabbc5817980c2fa84a1120b788516cf437b985
size 1461979
oid sha256:c1cc2ac5384a5ee41b4cdf1d83a72baf709f7cc8f3439fc5addedea723bbf96c
size 1467077

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1a32d361afa20fc8c20122a89b01fe14b45849da42663991e589579f70fb8577
size 46790
oid sha256:667280ce65e68ecf72202d1eb174114396300f2402e557e06677f23d22707790
size 47010

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c8d55205cf4225123da33895ed45eb186e5e57184ef5928400a4bae3ab6092be
size 88548
oid sha256:c8f17504759fd16d78fc0ac79d22b4daabc9cf723ff57128e3276aaf8c304446
size 88708

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:77ab9e2e18c788f8cdbec171269afe4d0a90c52abeda7063cae3766dcaa5e93b
size 120612
oid sha256:55c6d784f005e30fd05968b67a5afade2c0244449ead09b5eb4f24fa4e89238a
size 120408

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:36622a2f934503a7b60ded2f44b002e37eedde22d548dcf5a209f54c19548665
size 53064
oid sha256:685df94301659df0e221e6ca1f24d3f002858ad3a7c058b2e8ce70d8aa7104f0
size 53260

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4adeb7a77a0d0fe85097fcd190a99b49858dce11bde601d30335afcb6cc3d5f6
size 56276
oid sha256:45cc44cff4facce5d19d2447431f4cad717b385afe73a22ddaa48733a2208d1f
size 56463

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f45249f7cc90433a64856905c727571c4ef20468e2c7d3ac2029e18a0477932d
size 56743
oid sha256:bd14edfdb8384849755784c3b6b43b8e6e88392978a64bca2683002cf5ac1169
size 56905

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d437f68c521f3e627a1b50d46605e8b0b343c5fc3716d9669e8c4436c8992b6f
size 37602
oid sha256:668b64f04d3249b3046a125eb3a323f30934d35329dc10c711f58ea78d98cfa2
size 37847

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:08ba98437403a08cca825ed8e288c9f088a46d9a1081f0b0a4ed7fbb9b49bb85
size 37640
oid sha256:0f8644452fd5211f7ded1d73186c4d866aa49cb23d4087b2a126f87d8c3c5f62
size 37886

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e1ed0e40d08b2b9ea978a07a4b7bf282c9e2cba8c52896f12210f396241e1b78
size 66859
oid sha256:d1b80b2ae54d7e535700abf2036379c2477230353b53a5cba0bda9eebef32d3c
size 67123

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:28f9862dd6f16b99523f5880bf90346fd9455d0d44e7bdd530d523e0b2ef2d2c
size 158892
oid sha256:d018e524b432d24c32c641f889aab4e3d5e6192f8c22bb77e6a0f439dfdccf65
size 159486

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:98c40c99a237f8388d82259fba4388d7b1759fe7b4bf657d326532934135c934
size 61119
oid sha256:b4906bc38d36cb837b417445a24c091c488600bff67be4ed4fc98653ba79dbf3
size 61403

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:90d36311ce5b1dcf81cab22113620a3362f255059d1f52c6794c8249f960549e
size 152215
oid sha256:2e3c288d8e5cb768345f0577ad965cfb207b47bf37497a4283d28305dd8427ea
size 152658

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8f70ef032c241cd63675a246de07886c5c822e6fe21525b3a6d3fee106a589c9
size 7501
oid sha256:ec3b264d0243f950babd8eb943efcaa2d40b0fa586cf391ab6ff28e56f1318bb
size 7623

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dd6e159a462dde10240c4ca51da5ca5badfb7fc170bad97a59106babb72f8ae3
size 10795
oid sha256:1ed9c5dca0551d8e6177dc67def3e8819036e39d935e11f9ee77a974dd7a3306
size 10938

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8f2a5873350f85457d599c1fd165ac756ed69758e7647e160c64f44d2f35c804
size 21812
oid sha256:1f765cc56eb84b14d0c7d7804c5ec24f90ea8ba14ee288787aa5131d58365629
size 22072

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:facc05c499745594ac286f15645e40447633a176058337cad9edcb850ad578c7
size 29379
oid sha256:27c85c456e69f4d885ccf9af606e426138f6ca6b8e0762ea4806d6cc8225382c
size 29569

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9f23ff8c6782befdbe7bd5f076dcdda15c38555f8e505282369bf52e43938c1b
size 34194
oid sha256:231c72b67e733d7c12e76d28c4702cef9490d169e80f1388ad0b5276bd7184fc
size 34175

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2fa5cb5b96232d729f89be8cc92263715fe7197e72343b71e57e53a359afe181
size 19881
oid sha256:a525d62b50978bfa059f043f502ddf0ea4f8f88b2ec09cf7e07c53a7bf09e763
size 19969

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bb8d702361987803995c0f557ce94552a87b97dcd25bed5ee39af4c0e6090700
size 1904
oid sha256:18fbcc76f0df799331760e06487d6467aa2f575ac14d31d1859bf6ba3dba2941
size 2199

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:025942c144891b8862bf931385824e0484e60f4e7766f5d4401511c72ff20756
size 2975
oid sha256:08da2ac5bfb1e5ef7fb97cdc792bbf0529c20276312f0c444b122af02990e78b
size 3004

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:025942c144891b8862bf931385824e0484e60f4e7766f5d4401511c72ff20756
size 2975
oid sha256:08da2ac5bfb1e5ef7fb97cdc792bbf0529c20276312f0c444b122af02990e78b
size 3004

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c267530452adb4f1ed1440df476d576ef4c2d96e6c58068bb57fed4615f5e113
size 4453
oid sha256:b902df1b5971cd8d54a2e345f293bca2bf6f5ad262812ef8535f4191375e9dd2
size 4486

View File

@@ -8,15 +8,15 @@ use emath::{Rect, Vec2, vec2};
/// Negative margins are possible, but may produce weird behavior.
/// Use with care.
///
/// All values are stored as [`i16`] to keep the size of [`Margin`] small.
/// All values are stored as [`i8`] to keep the size of [`Margin`] small.
/// If you want floats, use [`crate::MarginF32`] instead.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct Margin {
pub left: i16,
pub right: i16,
pub top: i16,
pub bottom: i16,
pub left: i8,
pub right: i8,
pub top: i8,
pub bottom: i8,
}
impl Margin {
@@ -30,7 +30,7 @@ impl Margin {
/// The same margin on every side.
#[doc(alias = "symmetric")]
#[inline]
pub const fn same(margin: i16) -> Self {
pub const fn same(margin: i8) -> Self {
Self {
left: margin,
right: margin,
@@ -41,7 +41,7 @@ impl Margin {
/// Margins with the same size on opposing sides
#[inline]
pub const fn symmetric(x: i16, y: i16) -> Self {
pub const fn symmetric(x: i8, y: i8) -> Self {
Self {
left: x,
right: x,
@@ -98,9 +98,9 @@ impl Margin {
}
}
impl From<i16> for Margin {
impl From<i8> for Margin {
#[inline]
fn from(v: i16) -> Self {
fn from(v: i8) -> Self {
Self::same(v)
}
}
@@ -134,12 +134,12 @@ impl std::ops::Add for Margin {
}
}
/// `Margin + i16`
impl std::ops::Add<i16> for Margin {
/// `Margin + i8`
impl std::ops::Add<i8> for Margin {
type Output = Self;
#[inline]
fn add(self, v: i16) -> Self {
fn add(self, v: i8) -> Self {
Self {
left: self.left.saturating_add(v),
right: self.right.saturating_add(v),
@@ -149,10 +149,10 @@ impl std::ops::Add<i16> for Margin {
}
}
/// `Margin += i16`
impl std::ops::AddAssign<i16> for Margin {
/// `Margin += i8`
impl std::ops::AddAssign<i8> for Margin {
#[inline]
fn add_assign(&mut self, v: i16) {
fn add_assign(&mut self, v: i8) {
*self = *self + v;
}
}
@@ -214,12 +214,12 @@ impl std::ops::Sub for Margin {
}
}
/// `Margin - i16`
impl std::ops::Sub<i16> for Margin {
/// `Margin - i8`
impl std::ops::Sub<i8> for Margin {
type Output = Self;
#[inline]
fn sub(self, v: i16) -> Self {
fn sub(self, v: i8) -> Self {
Self {
left: self.left.saturating_sub(v),
right: self.right.saturating_sub(v),
@@ -229,10 +229,10 @@ impl std::ops::Sub<i16> for Margin {
}
}
/// `Margin -= i16`
impl std::ops::SubAssign<i16> for Margin {
/// `Margin -= i8`
impl std::ops::SubAssign<i8> for Margin {
#[inline]
fn sub_assign(&mut self, v: i16) {
fn sub_assign(&mut self, v: i8) {
*self = *self - v;
}
}

View File

@@ -1,92 +0,0 @@
#!/usr/bin/env bash
# This scripts runs various CI-like checks in a convenient way.
set -eu
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path/.."
set -x
# Checks all tests, lints etc.
# Basically does what the CI does.
# cargo +1.88.0 install --quiet typos-cli
export RUSTFLAGS="-D warnings"
export RUSTDOCFLAGS="-D warnings" # https://github.com/emilk/egui/pull/1454
# Fast checks first:
typos
./scripts/lint.py
cargo fmt --all -- --check
cargo doc --quiet --lib --no-deps --all-features
cargo doc --quiet --document-private-items --no-deps --all-features
cargo clippy --quiet --all-targets --all-features -- -D warnings
cargo clippy --quiet --all-targets --all-features --release -- -D warnings # we need to check release mode too
./scripts/clippy_wasm.sh
cargo check --quiet --all-targets
cargo check --quiet --all-targets --all-features
cargo check --quiet -p egui_demo_app --lib --target wasm32-unknown-unknown
cargo check --quiet -p egui_demo_app --lib --target wasm32-unknown-unknown --all-features
# TODO(#5297) re-enable --all-features once the tests work with the unity feature
cargo test --quiet --all-targets --all-features
cargo test --quiet --doc # slow - checks all doc-tests
cargo check --quiet -p eframe --no-default-features --features "glow"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
cargo check --quiet -p eframe --no-default-features --features "wgpu","x11"
cargo check --quiet -p eframe --no-default-features --features "wgpu","wayland"
else
cargo check --quiet -p eframe --no-default-features --features "wgpu"
fi
cargo check --quiet -p egui --no-default-features --features "serde"
cargo check --quiet -p egui_demo_app --no-default-features --features "glow"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu","x11"
cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu","wayland"
else
cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu"
fi
cargo check --quiet -p egui_demo_lib --no-default-features
cargo check --quiet -p egui_extras --no-default-features
cargo check --quiet -p egui_glow --no-default-features
cargo check --quiet -p egui-winit --no-default-features --features "wayland"
cargo check --quiet -p egui-winit --no-default-features --features "x11"
cargo check --quiet -p emath --no-default-features
cargo check --quiet -p epaint --no-default-features --release
cargo check --quiet -p epaint --no-default-features
cargo check --quiet -p eframe --all-features
cargo check --quiet -p egui --all-features
cargo check --quiet -p egui_demo_app --all-features
cargo check --quiet -p egui_extras --all-features
cargo check --quiet -p egui_glow --all-features
cargo check --quiet -p egui-winit --all-features
cargo check --quiet -p emath --all-features
cargo check --quiet -p epaint --all-features
./scripts/wasm_bindgen_check.sh
./scripts/cargo_deny.sh
# TODO(emilk): consider using https://github.com/taiki-e/cargo-hack or https://github.com/frewsxcv/cargo-all-features
# ------------------------------------------------------------
#
# For finding bloat:
# cargo bloat --release --bin egui_demo_app -n 200 | rg egui
# Also try https://github.com/google/bloaty
# what compiles slowly?
# cargo clean && time cargo build -p eframe --timings
# https://fasterthanli.me/articles/why-is-my-rust-build-so-slow
# what compiles slowly?
# cargo llvm-lines --lib -p egui | head -20
echo "All checks passed."

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4747efdf758e7e8e2d7f3954d9595dfd45d3b4b86923b8ff39c8a96002bb4825
size 408726
oid sha256:ef93c74cb71d7a5386cc361ca91b3826c27c257413eaafc8f283bd177111d6b6
size 409009

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4a3ca4b3a47ff516f9b05799cdf5f92845ae1e058728d635986cc61b7317f110
size 437102
oid sha256:554d51d9c557d8f7bc7ef6a5cac04520e0535074c2e762d8fc5ddd23b4a037bd
size 439301

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bfc900ea84b408564652df487e705311b164d9bd3ff5631c3cebb83b06497a7b
size 410131
oid sha256:c70f3d9e6e767b9857b218ef25166aa0fc5a1d8b72cb9582e1322d53a3f135e4
size 403775

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c9d08ce85c9210a7d9046480ab208040e5ba399c40acaecf5cb43f807534bce9
size 423523
oid sha256:e5188b61af6366680144486d927f8b497dcc1e836ae8e5d767c5bce59e05056a
size 446497

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:38f325f2e741f18f897502c176f9a7efe276e9adab41a144511121dd8b8a3073
size 3079
oid sha256:055b6111aa48f19c894729e2935cb9298231aab78efb10b9e73c00da9edfd338
size 3130

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1c05992e16c1abf6d174fed73d19cad6bb2266e0adb87b8232e765d75fcf3f14
size 10310
oid sha256:9df0ca1e011ccbba6e8620e2ef04b2e4f5614fd596a6dbc072179614552468c1
size 10118

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7681d33a5a764187c084c966a4e47063136e2832094c44f62718447b1b3027ec
size 11292
oid sha256:bf2a513396ba3ba90e65a163fcd21d1eb1277f59ede157c67e12f1f18cbe070a
size 11109

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b99a82e9f3dfa24c079545272d680b55c4285c276befa0efc492fe273422f541
size 14195
oid sha256:37cf0ae5fd2fb2e2f2b960b7ea451e380c335e42a0f4d45cacec90dfcb9bdb48
size 13981

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cdf079228b762949dbc67308103f8fe1328b6c0175f312ccc492d4e86d42127b
size 13868
oid sha256:79bc45bc2c675a9deddf25aad80de45170bd97d157bfb195cd59f1b027240652
size 14600

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0bafe4c157696bfb52940b69501416d4da0b4eab52f34f52220d2e9ed01357cf
size 12901
oid sha256:4f400f82eb9339c136f8ba2f393ae3b4832461fd2eca64cb4aa4f2ec60992d0c
size 13026

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:72175bf108135b422d978b701d29e6d9a5348c536e25abc924234bc11b6b7f21
size 14016
oid sha256:d96e5948ab50362475ab034e428804c1091b5dfacb8e3191021b1b13c3ce9c8e
size 14060

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:129121534b5f1a2a668898ebb3560820fe50aa4d3546ef46cc764d5513787e9e
size 7529
oid sha256:2fc2d9eaec38ec6cc5466117bfa6eedf027b2f8c5d146c16428e992e71352ee2
size 7526

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ac18e2eef000a80858b2d0811f9ee31304c6ff96f7a91dc60cc1a404ae28ce38
size 13246
oid sha256:eaf5722dc3d31272e1f804f46a472aa12cecf2744e617378514a8314f73c173a
size 12708

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c11fe0399c85db5a618580ec4c1f2fe76176c6ea0ead3710a430d9a2bf8acc5d
size 13352
oid sha256:7b1879c66f124ae40ce8e9fcbc1a36369ec141a31a0d5d9fb5306fe704772277
size 13784

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a103b51df184d5480438e8b537106432205a6d86f2927ab1bd507fe8ed3bb29b
size 7656
oid sha256:e2051b9aeef49c404b49c6b47b8ff34be66dff2c792f5eceba456f855ebdb8bc
size 7682