ribir_core 0.0.1-alpha.1

Ribir is a framework for building modern native/wasm cross-platform user interface applications.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::{
  prelude::{Painter, WidgetId},
  widget::{LayoutStore, TreeArena},
};

use super::{define_widget_context, WidgetCtxImpl, WindowCtx};

define_widget_context!(PaintingCtx, painter: &'a mut Painter);

impl<'a> PaintingCtx<'a> {
  /// Return the 2d painter to draw 2d things.
  #[inline]
  pub fn painter(&mut self) -> &mut Painter { self.painter }
}