Commit graph

228 commits

Author SHA1 Message Date
Emil Ernerfeldt
4e8a6e3370 misc code cleanup 2022-07-29 16:07:26 +02:00
Emil Ernerfeldt
51052c08e9 code cleanup: Pos2::new -> pos2, Vec2::new -> vec2 2022-07-29 14:34:26 +02:00
Matt Campbell
7a46a23db5
Update MSRV to Rust 1.61.0 (#1846) 2022-07-26 16:50:53 +02:00
Emil Ernerfeldt
8e2de26e4e Enable more clippy lints 2022-07-26 11:18:21 +02:00
Emil Ernerfeldt
cf591da1a0 Use past tense in all changelogs (for consistency) 2022-07-23 23:55:21 +02:00
Emil Ernerfeldt
fdc2d1cd6d epaint tessellator: don't emit empty meshes
Closes https://github.com/emilk/egui/issues/1772
2022-07-22 10:25:20 +02:00
Emil Ernerfeldt
898f4804b7 Enable and fix a bunch more lints 2022-07-11 23:08:48 +02:00
Emil Ernerfeldt
406703568e Minor clippy fixes (clippy::format_push_string) 2022-07-03 11:58:53 +02:00
wucke13
bd5f553c3a
Fix multiple partial updates of the same texture (#1338)
Co-authored-by: Wanja Zaeske <wanja.zaeske@dlr.de>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-06-19 22:49:06 +02:00
Emil Ernerfeldt
8c7c4c764b
Don't load fonts in doctests (#1711)
I was hoping this would speed up the doctests, but it doesn't really
2022-06-10 14:33:16 +02:00
Emil Ernerfeldt
29973e5d02 Make document-features an opt-in dependency 2022-06-09 17:41:37 +02:00
Emil Ernerfeldt
3169ce62d5
Document feature flags using crate document-features (#1725) 2022-06-09 15:27:22 +02:00
Emil Ernerfeldt
ac9faaf1c1 epaint_assert that partial texture update is within texture size 2022-05-29 21:00:49 +02:00
Zicklag
1d9524cc59
Re-implement PaintCallbacks With Support for WGPU (#1684)
* Re-implement PaintCallbacks With Support for WGPU

This makes breaking changes to the PaintCallback system, but makes it
flexible enough to support both the WGPU and glow backends with custom
rendering.

Also adds a WGPU equivalent to the glow demo for custom painting.
2022-05-28 17:52:36 +02:00
Emil Ernerfeldt
cc148ca895 Add texture filters to changelogs and improve docs 2022-05-22 17:32:38 +02:00
Zicklag
1a9a0d7ec8
Add the Ability to Specify Egui Texture Filters (#1636)
Only works for egui_glow
2022-05-22 16:56:51 +02:00
Emil Ernerfeldt
f3e305a646 Replace TODO: with TODO(emilk): and update code guidelines 2022-05-21 16:53:25 +02:00
Emil Ernerfeldt
d6fd5dec3b
Add single-threaded deadlock detection to RwMutex (#1619) 2022-05-21 14:08:19 +02:00
Emil Ernerfeldt
810b609a80 clippy fixes 2022-05-21 13:04:58 +02:00
Emil Ernerfeldt
934fcd7e99 Add hex_color clipboard fixes to changelogs 2022-05-21 13:04:58 +02:00
Erlend Walstad
f27f67b76b
Make color-hex optional (#1632) 2022-05-16 16:38:14 +02:00
Luke Newcomb
d2decfa338
Add ability to convert from a hex string to Color32 using macros (#1596) 2022-05-15 17:07:30 +02:00
Emil Ernerfeldt
7b18fab7a4
Optimize tessellation of filled circles (#1616)
When painting a scatter plot we sometimes want to paint hundreds of thousands of points (filled circles) on screen every frame.

In this PR the font texture atlas is pre-populated with some filled circled of various radii. These are then used when painting (small) filled circled, which means A LOT less triangles and vertices are generated for them.

In a new benchmark we can see a 10x speedup in circle tessellation, but the the real benefit comes in the painting of these circles: since we generate a lot less vertices, the backend painter has less to do.

In a real-life scenario with a lot of things being painted (including around 100k points) I saw tessellation go from 35ms -> 7ms and painting go from 45ms -> 1ms. This means the total frame time went from 80ms to 8ms, or a 10x speedup.
2022-05-10 19:31:19 +02:00
carrotflakes
cb2298e98b
Fix CircleShape::visual_bounding_rect() (#1575) 2022-05-05 09:16:00 +02:00
Emil Ernerfeldt
b30224471c
Release 0.18.1 of egui & epaint - Change Shape::Callback to &mut dyn Any (#1552) 2022-05-01 11:35:29 +02:00
Emil Ernerfeldt
dc26890a80 Release 0.18.0 - Shape::Callback, Table, and better text contrast 2022-04-30 20:27:27 +02:00
Emil Ernerfeldt
45b0a071c8 Clean up changelogs and add contributors section 2022-04-30 19:21:40 +02:00
Emil Ernerfeldt
00471f2887 Update cint 0.2 -> 0.3 2022-04-30 18:01:24 +02:00
Emil Ernerfeldt
8303523ccf
Precompute rounded vertices (#1547)
Co-authored-by: Daniel Buch Hansen <boogiewasthere@gmail.com>
2022-04-30 13:14:33 +02:00
Emil Ernerfeldt
06802cb0a0 Add Rounding::at_least and Rounding::at_most 2022-04-27 10:05:09 +02:00
Emil Ernerfeldt
1dee439ab1 Added CursorIcons for resizing columns, rows and 8 cardinal directions 2022-04-19 16:56:27 +02:00
bigfarts
2ca72e0bae
Add line breaking rules for Japanese text. Fixes #1497. (#1498)
This allows line breaks after any kana, unless they are immediately followed by a gyōtō kinsoku character, in which case the line may not break at that point.

Also pedantically renamed is_chinese to is_cjk_ideograph as is_chinese will also cause line breaks on Japanese kanji.
2022-04-16 10:36:16 +02:00
Emil Ernerfeldt
2355828d41 Remove epaint::mutex::Arc type alias 2022-04-15 15:18:21 +02:00
Emil Ernerfeldt
5a78213421
Enable depth buffer in WebGL backend (#1499)
This is useful when embedding 3D into eframe using egui::PaintCallback
2022-04-15 12:41:42 +02:00
Emil Ernerfeldt
f3e31391e0 Pass clip rectangle to PaintCallback 2022-04-15 10:31:33 +02:00
Emil Ernerfeldt
a7b6334784 Misc doc improvements 2022-04-13 22:14:34 +02:00
Alexis Sellier
b036257729
Make FontId functions constant (#1463) 2022-04-10 16:40:42 +02:00
Emil Ernerfeldt
c2ab0404b7
Fix crash in text layout (#1468)
Fix text layout bug added in https://github.com/emilk/egui/pull/1291
2022-04-09 22:43:40 +02:00
Emil Ernerfeldt
cf0338d48f
Rust 1.60.0 + refactor cargo features (#1467)
* Update to rust 1.60.0
* Rename the feature `convert_bytemuck` to `bytemuck`
* Rename the feature `serialize` to `serde`.
* Make use of the "weak dependency" cargo feature
* Set rust-version = "1.60" for all crates
* egui_glow: clipboard, links, persistence & winit are now opt-in features
2022-04-09 13:54:47 +02:00
Emil Ernerfeldt
7cd285ecbc misc clippy fixes from 1.60.0 2022-04-07 17:03:19 +02:00
Zachary Kohnen
dffab1c737
Add Shape::galley_with_color (#1461) 2022-04-06 18:47:46 +02:00
Emil Ernerfeldt
dfd6a91cb0 Fix doclinks 2022-04-03 20:38:51 +02:00
awaken1ng
901b7c7994
[epaint] Add more text wrapping options (#1291) 2022-04-03 20:28:47 +02:00
4JX
6091370962
Add more doc-links in docstrings (#1419) 2022-04-03 18:18:35 +02:00
Emil Ernerfeldt
10f30a0c52
Fix tessellation of Shape::Vec of heterogenous TextureId:s (#1445)
Closes https://github.com/emilk/egui/issues/1443
2022-04-03 18:14:27 +02:00
Emil Ernerfeldt
b7ebe16cfb
Storage and frame refactor (#1418)
The purpose of this is to expose `frame.storage()` and `frame.storage_mut()` so users can save/load app state from the `App::update` function, without having to add another parameter to that function.

Changes:
* Added `Frame::storage()` and `Frame::storage_mut()`
* `App::update` now takes a `&mut Frame` rather than just `&Frame`
* `Frame` is no longer `Clone` or `Sync` (doesn't have to be since https://github.com/emilk/egui/pull/1366)
2022-03-25 21:19:31 +01:00
Emil Ernerfeldt
8272b08742
Improve text contrast in bright mode (#1412)
* Rename AlphaImage to FontImage to discourage any other use for it
* Encode FontImage as f32 and postpone the alpha correction
* Interpret alpha coverage in a new, making dark text darker, improving contrast in bright mode
2022-03-23 16:49:49 +01:00
Emil Ernerfeldt
1387d6e9d6
Refactor TessellationOptions to expose slider for feathering size (#1408)
The epaint tessellator uses "feathering" to accomplish anti-aliasing. This PS allows you to control the feathering size, i.e. how blurry the edges of epaint shapes are.

This changes the interface of Tessellator slightly, and renames some options in TessellationOptions.
2022-03-23 11:41:38 +01:00
Emil Ernerfeldt
ea9393aa9b
glow painter improvements (#1406)
* Add viewport info to PaintCallback
* glow: be more explicit with more state
* glow: Refactor VAO
2022-03-22 23:11:27 +01:00
Emil Ernerfeldt
41b178b6ec
Use atomic_refcell instead of parking_lot for wasm32 targets (#1404)
Closes https://github.com/emilk/egui/issues/1401
2022-03-22 15:34:21 +01:00