Commit Graph

199 Commits

Author SHA1 Message Date
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
Hunter522 0a400a5bcc
Add Image::rotate and Mesh::rotate (#1371)
Co-authored-by: Hunter Morgan <hmorgan@bellflight.com>
2022-03-22 08:44:23 +01:00
Emil Ernerfeldt 15254f8235
Remove the single_threaded/multi_threaded feature flags (#1390)
Always use parking_lot for mutexes, i.e. always be multi-threaded.

Closes #1379
2022-03-21 22:20:37 +01:00
Emil Ernerfeldt fda8189cba
Move lints list to `.carg/config.toml` (#1394)
That way they apply to all crates equally.

See https://github.com/EmbarkStudios/rust-ecosystem/issues/22 for why.
2022-03-21 16:54:29 +01:00
Emil Ernerfeldt fde9c232b3 Improve the introspection paint stats 2022-03-20 23:05:16 +01:00
Emil Ernerfeldt 861e129ace Add Shape::image convenience method 2022-03-20 20:39:48 +01:00
jean-airoldie 734d4c57ad
Expose more epaint tessellator methods (#1384)
* Expose more tessellator method

* Make public the Tessellator methods to tessellate a circle, a
    mesh, a rectangle, a line, a path, a quadratic and cubic
    bezier curve.
* Add doc to tessellate_text.
* Add Mesh::append_ref method.

* Make tessellate_text take a reference

* Fix breaking change in benchmark
2022-03-20 20:38:48 +01:00
jean-airoldie 0d47e57775
Add Tessellator::set_clip_rect (#1369)
This allows the user to set the outer rectangle used for culling,
which is required to be able to implement its own tessellate_shapes.
2022-03-19 13:01:33 +01:00
Emil Ernerfeldt 6aee4997d4
Add Shape::Callback to do custom rendering inside of an egui UI (#1351)
* Add Shape::Callback to do custom rendering inside of an egui UI
* Use Rc<glow::Context> everywhere
* Remove trait WebPainter
* Add glow::Context to epi::App::setup
2022-03-14 13:25:11 +01:00
Emil Ernerfeldt 510cef02ca Run a formatter on all toml files 2022-03-10 14:25:33 +01:00
Emil Ernerfeldt a05520b9d3 Release 0.17.0 - Improved font selection and image handling 2022-02-22 19:32:30 +01:00
Emil Ernerfeldt 31d324932c
Introduce egui::FullOutput, returned from Context::run (#1292)
* Introduce `egui::FullOutput`, returned from `Context::run`
* Rename `Output` to `PlatformOutput`
2022-02-22 17:13:53 +01:00
Emil Ernerfeldt c5a9421dbd
Run wasm-bindgen in CI and update parking_lot (#1293)
* Run wasm-bindgen in CI
* Update parking_lot 0.11 -> 0.12
2022-02-22 16:30:42 +01:00
Emil Ernerfeldt 2e1a4cf08a impl std::fmt::Debug for TexturesDelta 2022-02-22 13:21:41 +01:00
Emil Ernerfeldt 76f564428b Implement Serialize/Deserialize for `TextShape` 2022-02-22 13:20:46 +01:00
Emil Ernerfeldt a90379ac8d Ignore characters that are wrong in `emoji-icon-font.ttf`
Closes https://github.com/emilk/egui/issues/1284
2022-02-22 09:47:31 +01:00
Emil Ernerfeldt 2af1dda4c3 Add TexturesDelta::clear 2022-02-21 21:51:21 +01:00
Emil Ernerfeldt 8f887e2ebd Add Shape::visual_bounding_rect() 2022-02-21 21:46:30 +01:00
Emil Ernerfeldt 6d68838821 Clean up changelogs 2022-02-21 16:10:05 +01:00
Emil Ernerfeldt 89d19860b8 Misc code cleanup, docs fixes, etc 2022-02-19 20:58:28 +01:00
Emil Ernerfeldt e49245fae5 Improve the anti-aliasing of filled paths with sharp corners
This comes at the cost of these corners sometimes becoming badly
extruded instead. The sharper the corner, the bigger the problem.

A proper fix will have to wait for later.

Part of https://github.com/emilk/egui/issues/1226
2022-02-19 20:46:44 +01:00
Emil Ernerfeldt b8fbbf7d62 Fix anti-aliasing of filled paths with counter-clockwise winding order
Part of https://github.com/emilk/egui/issues/1226
2022-02-19 20:46:44 +01:00
Emil Ernerfeldt 10634fc344 Improve the Bézier demo: drag control points and simplify code
Follow-up to https://github.com/emilk/egui/pull/1178
2022-02-19 20:46:44 +01:00
Emil Ernerfeldt 3a5ec4733f Fix bug when debug-painting clip rectangles 2022-02-19 20:46:40 +01:00
4JX 14e985a894
Expose `FontTweak` through `egui::FontTweak` (#1244) 2022-02-13 10:10:39 +01:00
Emil Ernerfeldt 69626296f1
Make v-align and scale of user fonts tweakable (#1241)
* Add ability to "tweak" the scale and y-offsets of individual fonts
* Change default font tweak

This help vertically center large text.
2022-02-12 18:22:42 +01:00
4JX c9098288f5
Fix a typo: tolerence -> tolerance (#1214) 2022-02-06 16:30:34 +01:00
Emil Ernerfeldt 9ed96155e9 Rename corner_radius to rounding
Also update changelogs and clean up other aspects of
https://github.com/emilk/egui/pull/1206
2022-02-05 18:13:46 +01:00
4JX 7e7b9e1919
Per-corner rounding of rectangles (#1206)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-02-05 17:48:55 +01:00
Emil Ernerfeldt 0fa4bb9c64 Clean up all Cargo.toml: put features higher, and document them better 2022-02-05 11:11:15 +01:00