mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
@@ -468,6 +468,8 @@ fn should_prioritize_hits_on_back(back: Rect, front: Rect) -> bool {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#![expect(clippy::print_stdout)]
|
||||
|
||||
use emath::{Rect, pos2, vec2};
|
||||
|
||||
use crate::{Id, Sense};
|
||||
|
||||
@@ -648,6 +648,8 @@ impl ViewportBuilder {
|
||||
/// returning a list of commands and a bool indicating if the window needs to be recreated.
|
||||
#[must_use]
|
||||
pub fn patch(&mut self, new_vp_builder: Self) -> (Vec<ViewportCommand>, bool) {
|
||||
#![expect(clippy::useless_let_if_seq)] // False positive
|
||||
|
||||
let Self {
|
||||
title: new_title,
|
||||
app_id: new_app_id,
|
||||
|
||||
@@ -422,10 +422,12 @@ impl RichText {
|
||||
font_id
|
||||
};
|
||||
|
||||
let mut background_color = background_color;
|
||||
if code {
|
||||
background_color = style.visuals.code_bg_color;
|
||||
}
|
||||
let background_color = if code {
|
||||
style.visuals.code_bg_color
|
||||
} else {
|
||||
background_color
|
||||
};
|
||||
|
||||
let underline = if underline {
|
||||
crate::Stroke::new(1.0, line_color)
|
||||
} else {
|
||||
|
||||
@@ -938,11 +938,9 @@ fn animated_image_frame_index(ctx: &Context, uri: &str) -> usize {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
0
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
||||
0
|
||||
}
|
||||
|
||||
/// Checks if uri is a gif file
|
||||
|
||||
@@ -929,12 +929,10 @@ fn events(
|
||||
event if cursor_range.on_event(os, event, galley, id) => None,
|
||||
|
||||
Event::Copy => {
|
||||
if cursor_range.is_empty() {
|
||||
None
|
||||
} else {
|
||||
if !cursor_range.is_empty() {
|
||||
copy_if_not_password(ui, cursor_range.slice_str(text.as_str()).to_owned());
|
||||
None
|
||||
}
|
||||
None
|
||||
}
|
||||
Event::Cut => {
|
||||
if cursor_range.is_empty() {
|
||||
|
||||
@@ -321,6 +321,8 @@ fn try_image_snapshot_options_impl(
|
||||
name: String,
|
||||
options: &SnapshotOptions,
|
||||
) -> SnapshotResult {
|
||||
#![expect(clippy::print_stdout)]
|
||||
|
||||
let SnapshotOptions {
|
||||
threshold,
|
||||
output_path,
|
||||
|
||||
@@ -830,6 +830,7 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[expect(clippy::print_stdout)]
|
||||
#[test]
|
||||
fn test_ray_intersection() {
|
||||
let rect = Rect::from_min_max(pos2(1.0, 1.0), pos2(3.0, 3.0));
|
||||
|
||||
@@ -613,6 +613,8 @@ struct FlatteningParameters {
|
||||
impl FlatteningParameters {
|
||||
// https://raphlinus.github.io/graphics/curves/2019/12/23/flatten-quadbez.html
|
||||
pub fn from_curve(curve: &QuadraticBezierShape, tolerance: f32) -> Self {
|
||||
#![expect(clippy::useless_let_if_seq)]
|
||||
|
||||
// Map the quadratic bézier segment to y = x^2 parabola.
|
||||
let from = curve.points[0];
|
||||
let ctrl = curve.points[1];
|
||||
|
||||
@@ -1165,6 +1165,7 @@ mod tests {
|
||||
]
|
||||
}
|
||||
|
||||
#[expect(clippy::print_stdout)]
|
||||
#[test]
|
||||
fn test_split_paragraphs() {
|
||||
for pixels_per_point in [1.0, 2.0_f32.sqrt(), 2.0] {
|
||||
|
||||
@@ -554,6 +554,8 @@ fn halign_and_justify_row(
|
||||
wrap_width: f32,
|
||||
justify: bool,
|
||||
) {
|
||||
#![expect(clippy::useless_let_if_seq)] // False positive
|
||||
|
||||
let row = Arc::make_mut(&mut placed_row.row);
|
||||
|
||||
if row.glyphs.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user