Commit graph

153 commits

Author SHA1 Message Date
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
Emil Ernerfeldt
47038c631e Update image 0.23 -> 0.24 2022-02-04 13:31:06 +01:00
Emil Ernerfeldt
c6ac1827f6
Use tracing crate for logging (#1192)
* egui_web: use tracing crate
* egui_glow: use tracing crate
* Log at the debug level
* egui_demo_app: enable tracing to log to stdout
* Use tracing in egui-winit
* Add opt-in tracing support to egui
2022-02-01 12:27:39 +01:00
Xu Desheng
1f03f53dc0
Add Bezier Shapes #1120 (#1178) 2022-01-31 20:26:31 +01:00
Emil Ernerfeldt
b5aaa5fa6f Improve some feature flags 2022-01-31 19:24:56 +01:00
Emil Ernerfeldt
417bb3123a Fonts: only pre-render glyphs for fonts in the current egui styles 2022-01-26 14:42:44 +01:00
Emil Ernerfeldt
7ed0880b8f
Lower default font atlas size (#1160)
In https://github.com/emilk/egui/pull/1154 the default was set to
16k x 512, which is way excessive, as most of it will be blank.

This PR changes it to 8k x 64, which will make egui
use less RAM and VRAM, and load quicker again.

This also decreases the max size from 16k² to 8k².
That should be enough.
2022-01-25 01:04:28 +01:00
Emil Ernerfeldt
fa43d16c41
Choose your own font and size (#1154)
* Refactor text layout: don't need &Fonts in all functions
* Replace indexing in Fonts with member function
* Wrap Fonts in a Mutex
* Remove mutex for Font::glyph_info_cache
* Remove RwLock around Font::characters
* Put FontsImpl and GalleyCache behind the same Mutex
* Round font sizes to whole pixels before deduplicating them
* Make TextStyle !Copy
* Implement user-named TextStyle:s
* round font size earlier
* Cache fonts based on family and size
* Move TextStyle into egui and Style
* Remove body_text_style
* Query graphics about max texture size and use that as font atlas size
* Recreate texture atlas when it is getting full
2022-01-24 14:32:36 +01:00
Emil Ernerfeldt
462f181db3
Partial font texture update (#1149) 2022-01-22 11:23:12 +01:00
Emil Ernerfeldt
199bbef77b Add misc documentation 2022-01-22 09:07:41 +01:00
Mingun
87ae77aab0
Add some improvements in the documentation (#1056)
* Better documentation for align.rs
* Document some painting methods
* Fix broken intra-doc links
* Add some internal documentation for Window TitleBar
2022-01-16 22:06:28 +01:00
Emil Ernerfeldt
66d80e2519
Texture loading in egui (#1110)
* Move texture allocation into epaint/egui proper
* Add TextureHandle
* egui_glow: cast using bytemuck instead of unsafe code
* Optimize glium painter
* Optimize WebGL
* Add example of loading an image from file
2022-01-15 13:59:52 +01:00
Emil Ernerfeldt
d5673412dd
Put everything in Context behind the same Mutex (#1050)
* Move all interior mutability from Context to CtxRef and make it a handle
* Rename `CtxRef` to `Context`
* The old `Context` is now `ContextImpl` and is non-pub
* Add benchmark Painter::rect

Co-authored-by: Daniel Keller <dklr433@gmail.com>
2022-01-10 23:13:10 +01:00
Emil Ernerfeldt
342737e2f0 Improve a couple of docstrings 2022-01-08 11:15:15 +01:00
Lampsitter
d31f7d6522
Faster dashed line generation (#1027)
* Faster dashed lines generation

* Add dashed_line benchmark
2022-01-06 10:44:53 +01:00
Emil Ernerfeldt
0960f38552 Add inter-linking between different forms of documentations and examples 2021-12-29 21:44:48 +01:00
Emil Ernerfeldt
0146c7e7fc Release 0.16.0 - Context menus and rich text 2021-12-29 12:07:05 +01:00
Emil Ernerfeldt
190c85a40f Rename Texture to FontImage 2021-12-28 21:19:24 +01:00
Emil Ernerfeldt
d5efa4bbca 1.56 fix: missing_crate_level_docs -> rusdoc::missing_crate_level_docs 2021-12-26 09:56:14 +01:00
Emil Ernerfeldt
c60d17b91b
Set MSRV to 1.56.0 and use rust edition 2021 (#998) 2021-12-25 19:32:25 +01:00
Jan Haller
5ec14867c8
OrderedFloat refactor (#918)
* Move egui/util/float_ord.rs -> epaint/util/ordered_float.rs

* Implement Hash on OrderedFloat

* Generic OrderedFloat<T>; impl Hash; documentation
2021-12-11 13:52:23 +01:00
Emil Ernerfeldt
5fee6b7bc5
Anti-alias path ends (#893)
Closes https://github.com/emilk/egui/issues/876
2021-11-14 17:23:51 +01:00
Emil Ernerfeldt
951ee4e142
Improve color picker cache (#886)
* colorpicker: try to maintain hue even when saturation goes to zero
* More consistent arguments to color types
* implement `Hash` for `Rgba`.
2021-11-07 21:11:42 +01:00
Emil Ernerfeldt
878eddd546
When using a custom font you can now specify a font index (#873)
When using a custom font you can now specify a font index

Closes https://github.com/emilk/egui/issues/853
2021-11-07 19:47:52 +01:00
Emil Ernerfeldt
09b8269326
Rich text for all widgets (#855)
Introduce `RichText` and `WidgetText`
2021-11-01 21:30:10 +01:00
Emil Ernerfeldt
78dfde40b2 Remove deprecated functions 2021-10-30 09:46:06 +02:00
Emil Ernerfeldt
ddd52f47c5 Add tessellation option to toggle rounding text to pixel coordinates
On by default and only there for testing
2021-10-27 08:56:06 +02:00
Emil Ernerfeldt
8e4fd942a9
Refactor memory data (#836)
This refactors the widget state storage introduced by @optozorax in https://github.com/emilk/egui/pull/257

* Unify the four buckets (`data`, `data_temp`, `id_data` and `id_data_temp`) into a single `data`.
  * Less complexity, and also less chance of error (storing in one bucket, reading from another).
* Store data by `Id` and `TypeId`.
  * Users can thus reuse the same `Id` to store many types.
  * Uses a simple xor of id and typeid, which is fast and good since both id and typeid are already high-entropy hashes.
* Use different suffixes on the functions to pick if you want the data persisted or not (`get_temp`, `insert_persisted`, etc).
  * Writing with one suffix and reading with the other works.
* To store state not bound to a specific `Id` (i.e. only based on type), use the new `Id::null` as the key.
2021-10-27 08:51:34 +02:00
Emil Ernerfeldt
08cc07bb2d Release 0.15.0 - Syntax highlighting, hscroll, egui-winit and egui_glow 2021-10-24 16:15:07 +02:00
Emil Ernerfeldt
4ace85b780 Fix: '\t' always take up the width of four spaces 2021-10-23 14:38:26 +02:00
Emil Ernerfeldt
2a9037cd90 Clean up epaint mutex code 2021-10-20 22:24:34 +02:00
Emil Ernerfeldt
dd50cba9a7 Optimize debug builds 2021-10-20 21:58:35 +02:00
Emil Ernerfeldt
d97a369c44 End statements with semicolon (clippy::semicolon_if_nothing_returned) 2021-10-20 16:46:57 +02:00
Emil Ernerfeldt
a0cd41755e Add more clippy lints 2021-10-20 16:30:39 +02:00
Emil Ernerfeldt
087c6695bb Handle having no fonts (missing "default_fonts" feature) without a crash 2021-10-20 15:40:06 +02:00
Emil Ernerfeldt
1f5cd482f6
Replace ProggyClean.ttf with Hack-Regular.ttf as default monospace font (#802)
https://github.com/source-foundry/Hack, MIT license
2021-10-17 20:49:28 +02:00
Emil Ernerfeldt
6f699b3391 Replace every ... with … like some sort of crazy person
Also fix some small typos

Closes https://github.com/emilk/egui/pull/736
2021-10-13 11:52:34 +02:00
Emil Ernerfeldt
1ab61ce9bb Implement bytemuck for epaint::Rgba
Closes https://github.com/emilk/egui/pull/784
2021-10-13 08:56:34 +02:00
Emil Ernerfeldt
e547b149ca Improve docs, especially of epaint, and add epaint/CHANGELOG.md 2021-10-10 15:35:13 +02:00
Emil Ernerfeldt
22a3a75eb5 Optimization: replace HashSet uses with AHashSet 2021-10-09 14:15:45 +02:00
Stock84
cd2227814f
Implement bytemuck behind a feature (#775) 2021-10-07 22:30:15 +02:00
Emil Ernerfeldt
a1bf5aff47 Add Memory::caches for caching things from one frame to the next 2021-10-06 17:54:45 +02:00
Emil Ernerfeldt
f59abd9684 Clean up some macro syntax 2021-10-02 21:08:00 +02:00
Emil Ernerfeldt
5539dbe620
Add separate serialize feature and better persitence control (#753)
* Rename epaint feature "persistence" to "serialize"

* Add separate "serialize" feature to egui

* egui_demo_lib: separate serialize and persistence features

* Add App::persist_native_window and App::persist_egui_memory

Controls what gets persisted
2021-09-29 08:45:13 +02:00
Emil Ernerfeldt
d9db768180 Optimize tessellator: pass options by reference 2021-09-28 18:00:01 +02:00
Emil Ernerfeldt
2e83e36146 Use ahash for Id and other things that need hashing 2021-09-28 17:56:24 +02:00
Emil Ernerfeldt
1b36863248
Split out new crate egui-winit from egui_glium (#735) 2021-09-28 17:33:28 +02:00