Commit graph

71 commits

Author SHA1 Message Date
Emil Ernerfeldt
d7f9e2246c Add a bunch on inline annotations 2021-04-01 23:07:15 +02:00
Emil Ernerfeldt
0a21b01c31 Fix nightly build: remove deprecated missing_crate_level_docs lint
Closes https://github.com/emilk/egui/issues/250 and
https://github.com/emilk/egui/pull/251
2021-03-31 20:00:22 +02:00
Emil Ernerfeldt
46425f1e38 Optimize: add #[inline(always)] to various low-level things
saves up to 20% (text tesselation), and at least 5% overall
2021-03-28 23:16:19 +02:00
Emil Ernerfeldt
5481aa8d98 Add DragValue::new and Slider::new 2021-03-27 16:03:11 +01:00
Emil Ernerfeldt
fd3444473f Add some clippy lints 2021-03-23 19:53:31 +01:00
Emil Ernerfeldt
f5c372910c Replace emath::clamp with f32::clamp (new in rustc 1.50) 2021-03-21 17:47:03 +01:00
Emil Ernerfeldt
ec9f374d8c Fix: centered horizontal layouts should never overflow upwards 2021-03-21 10:31:18 +01:00
Emil Ernerfeldt
5621a46b4b emath: add any_nan to Vec2, Pos2 and Rect 2021-03-20 16:18:04 +01:00
Emil Ernerfeldt
4e852727c0 Add helper functions to Rect 2021-03-20 16:17:58 +01:00
Emil Ernerfeldt
82350a2f1e Improve documentation 2021-02-21 10:12:08 +01:00
Emil Ernerfeldt
a19140ec67 A simple 2D plot library 2021-02-17 22:54:10 +01:00
Emil Ernerfeldt
c376d0bb7e [emath] RectTransform: transforms Pos2 from one Rect to another
Very useful for transforming coordinate systems, e.g. for painting
2021-02-14 10:33:44 +01:00
Emil Ernerfeldt
5ce681ef16 Improve documentation 2021-02-07 17:04:03 +01:00
xue-blood
ce14fa860b
Speed up fractal_clock painting (#152)
clip unwatchable line before drawing
2021-02-06 16:59:46 +01:00
Emil Ernerfeldt
2d9d06dbff [emath] Use const values for Vec2::ZERO, Rect::EVERYTHING etc 2021-02-05 10:11:39 +01:00
Emil Ernerfeldt
38ca36724a [emath] Pos2: add conversions to/from (f32, f32) and [f32; 2]
Useful for places where we have `impl Into<Pos2>` as an argument
2021-01-25 21:11:19 +01:00
Emil Ernerfeldt
247026149c
Multiple mouse button support (#135)
Add support for primary, secondary and middle mouse buttons. Also improve ability to click things in low FPS situations.

This introduces a lot of breaking changes:

    Backends/integrations now pass mouse events via the even stream.
    Response has an interface of mostly methods instead of public members.
    input.mouse is now input.pointer and has new interface.


* Rename 'mouse' to 'pointer' everywhere (pointer = mouse or touch)

* Make Response::clicked and Response::double_clicked into methods

* Remove Response::active and add dragged() and interact_pointer_pos()

* Support multiple mouse buttons

* Make PointerState interface all methods

* Make most members of Response private
2021-01-25 18:50:19 +01:00
Emil Ernerfeldt
31b7eda51e Rename Egui to egui
Also update iamges in README.md
2021-01-17 14:48:59 +01:00
Emil Ernerfeldt
1f2aebc25a Improve documentation 2021-01-17 12:24:13 +01:00
Emil Ernerfeldt
d11b02d45e [emath] Add Pos2::zero() and Rect::clamp(point) 2021-01-17 00:21:31 +01:00
Emil Ernerfeldt
a0b0f36d29 Move egui/math into new crate emath 2021-01-10 11:37:47 +01:00