mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
RectShape: add control over where the stoke goes (#5647)
Adds `RectShape::stroke_kind` so you can select if the stroke goes inside, outside, or is centered on the rectangle. Also adds `RectShape::round_to_pixels` so you can override `TessellationOptions::round_rects_to_pixels`.
This commit is contained in:
@@ -56,17 +56,17 @@ impl std::hash::Hash for Stroke {
|
||||
}
|
||||
|
||||
/// Describes how the stroke of a shape should be painted.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||
pub enum StrokeKind {
|
||||
/// The stroke should be painted entirely outside of the shape
|
||||
Outside,
|
||||
|
||||
/// The stroke should be painted entirely inside of the shape
|
||||
Inside,
|
||||
|
||||
/// The stroke should be painted right on the edge of the shape, half inside and half outside.
|
||||
Middle,
|
||||
|
||||
/// The stroke should be painted entirely outside of the shape
|
||||
Outside,
|
||||
}
|
||||
|
||||
impl Default for StrokeKind {
|
||||
|
||||
Reference in New Issue
Block a user