mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Correct event relativization in Panel
This commit is contained in:
parent
67a6640142
commit
ab1f4a2ba6
@ -1,4 +1,5 @@
|
|||||||
use Printer;
|
use Printer;
|
||||||
|
use event::{Event, EventResult};
|
||||||
use vec::Vec2;
|
use vec::Vec2;
|
||||||
use view::{View, ViewWrapper};
|
use view::{View, ViewWrapper};
|
||||||
|
|
||||||
@ -18,6 +19,10 @@ impl<V: View> Panel<V> {
|
|||||||
impl<V: View> ViewWrapper for Panel<V> {
|
impl<V: View> ViewWrapper for Panel<V> {
|
||||||
wrap_impl!(self.view: V);
|
wrap_impl!(self.view: V);
|
||||||
|
|
||||||
|
fn wrap_on_event(&mut self, event: Event) -> EventResult {
|
||||||
|
self.view.on_event(event.relativized((1, 1)))
|
||||||
|
}
|
||||||
|
|
||||||
fn wrap_required_size(&mut self, req: Vec2) -> Vec2 {
|
fn wrap_required_size(&mut self, req: Vec2) -> Vec2 {
|
||||||
// TODO: make borders conditional?
|
// TODO: make borders conditional?
|
||||||
let req = req.saturating_sub((2, 2));
|
let req = req.saturating_sub((2, 2));
|
||||||
|
Loading…
Reference in New Issue
Block a user