Skip to content

Commit

Permalink
Fix Color32 imports
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargus committed Aug 18, 2024
1 parent c2346d5 commit 1f75b02
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
9 changes: 2 additions & 7 deletions crates/egui/src/painter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ impl Painter {
&self,
text: String,
font_id: FontId,
color: crate::Color32,
color: Color32,
wrap_width: f32,
) -> Arc<Galley> {
self.fonts(|f| f.layout(text, font_id, color, wrap_width))
Expand All @@ -476,12 +476,7 @@ impl Painter {
/// Paint the results with [`Self::galley`].
#[inline]
#[must_use]
pub fn layout_no_wrap(
&self,
text: String,
font_id: FontId,
color: crate::Color32,
) -> Arc<Galley> {
pub fn layout_no_wrap(&self, text: String, font_id: FontId, color: Color32) -> Arc<Galley> {
self.fonts(|f| f.layout(text, font_id, color, f32::INFINITY))
}

Expand Down
6 changes: 3 additions & 3 deletions crates/egui/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1092,11 +1092,11 @@ impl Response {
self.ctx.debug_painter().debug_rect(
self.rect,
if self.hovered {
crate::Color32::DARK_GREEN
ecolor::Color32::DARK_GREEN
} else if self.enabled {
crate::Color32::BLUE
ecolor::Color32::BLUE
} else {
crate::Color32::RED
ecolor::Color32::RED
},
format!("{:?}", self.id),
);
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/widget_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ impl RichText {
} = self;

let line_color = text_color.unwrap_or_else(|| style.visuals.text_color());
let text_color = text_color.unwrap_or(crate::Color32::PLACEHOLDER);
let text_color = text_color.unwrap_or(Color32::PLACEHOLDER);

let font_id = {
let mut font_id = text_style
Expand Down
6 changes: 3 additions & 3 deletions crates/epaint/src/text/fonts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ impl Fonts {
&self,
text: String,
font_id: FontId,
color: crate::Color32,
color: ecolor::Color32,
wrap_width: f32,
) -> Arc<Galley> {
let job = LayoutJob::simple(text, font_id, color, wrap_width);
Expand All @@ -529,7 +529,7 @@ impl Fonts {
&self,
text: String,
font_id: FontId,
color: crate::Color32,
color: ecolor::Color32,
) -> Arc<Galley> {
let job = LayoutJob::simple(text, font_id, color, f32::INFINITY);
self.layout_job(job)
Expand All @@ -544,7 +544,7 @@ impl Fonts {
font_id: FontId,
wrap_width: f32,
) -> Arc<Galley> {
self.layout(text, font_id, crate::Color32::PLACEHOLDER, wrap_width)
self.layout(text, font_id, ecolor::Color32::PLACEHOLDER, wrap_width)
}
}

Expand Down

0 comments on commit 1f75b02

Please sign in to comment.