allow deprecated round_rect_to_pixels
This commit is contained in:
committed by
William Casarin
parent
27f4acea1c
commit
2f4d9442f0
@@ -58,6 +58,7 @@ pub fn padding<R>(
|
||||
pub fn hline(ui: &egui::Ui) {
|
||||
// pixel perfect horizontal line
|
||||
let rect = ui.available_rect_before_wrap();
|
||||
#[allow(deprecated)]
|
||||
let resize_y = ui.painter().round_to_pixel(rect.top()) - 0.5;
|
||||
let stroke = ui.style().visuals.widgets.noninteractive.bg_stroke;
|
||||
ui.painter().hline(rect.x_range(), resize_y, stroke);
|
||||
|
||||
@@ -233,6 +233,7 @@ fn handle_lud16(ui: &mut egui::Ui, lud16: &str) {
|
||||
fn copy_key_widget(pfp_rect: &egui::Rect) -> impl egui::Widget + '_ {
|
||||
|ui: &mut egui::Ui| -> egui::Response {
|
||||
let painter = ui.painter();
|
||||
#[allow(deprecated)]
|
||||
let copy_key_rect = painter.round_rect_to_pixels(egui::Rect::from_center_size(
|
||||
pfp_rect.center_bottom(),
|
||||
egui::vec2(48.0, 28.0),
|
||||
@@ -262,6 +263,7 @@ fn copy_key_widget(pfp_rect: &egui::Rect) -> impl egui::Widget + '_ {
|
||||
))
|
||||
.paint_at(
|
||||
ui,
|
||||
#[allow(deprecated)]
|
||||
painter.round_rect_to_pixels(egui::Rect::from_center_size(
|
||||
copy_key_rect.center(),
|
||||
egui::vec2(16.0, 16.0),
|
||||
@@ -276,6 +278,7 @@ fn edit_profile_button() -> impl egui::Widget + 'static {
|
||||
|ui: &mut egui::Ui| -> egui::Response {
|
||||
let (rect, resp) = ui.allocate_exact_size(vec2(124.0, 32.0), Sense::click());
|
||||
let painter = ui.painter_at(rect);
|
||||
#[allow(deprecated)]
|
||||
let rect = painter.round_rect_to_pixels(rect);
|
||||
|
||||
painter.rect_filled(
|
||||
@@ -315,6 +318,7 @@ fn edit_profile_button() -> impl egui::Widget + 'static {
|
||||
let edit_icon_rect = {
|
||||
let mut center = galley_rect.left_center();
|
||||
center.x -= half_icon_size + space_between_icon_galley;
|
||||
#[allow(deprecated)]
|
||||
painter.round_rect_to_pixels(Rect::from_center_size(
|
||||
painter.round_pos_to_pixel_center(center),
|
||||
edit_icon_size,
|
||||
|
||||
@@ -180,6 +180,7 @@ fn goto_top_button(center: Pos2) -> impl egui::Widget {
|
||||
);
|
||||
let helper = AnimationHelper::new_from_rect(ui, "goto_top", {
|
||||
let painter = ui.painter();
|
||||
#[allow(deprecated)]
|
||||
let center = painter.round_pos_to_pixel_center(center);
|
||||
egui::Rect::from_center_size(center, max_size)
|
||||
});
|
||||
@@ -197,10 +198,13 @@ fn goto_top_button(center: Pos2) -> impl egui::Widget {
|
||||
Pos2 { x, y }
|
||||
};
|
||||
|
||||
#[allow(deprecated)]
|
||||
let left_pt =
|
||||
painter.round_pos_to_pixel_center(helper.scale_pos_from_center(create_pt(-PI)));
|
||||
#[allow(deprecated)]
|
||||
let center_pt =
|
||||
painter.round_pos_to_pixel_center(helper.scale_pos_from_center(create_pt(-PI / 2.0)));
|
||||
#[allow(deprecated)]
|
||||
let right_pt =
|
||||
painter.round_pos_to_pixel_center(helper.scale_pos_from_center(create_pt(0.0)));
|
||||
|
||||
@@ -247,6 +251,7 @@ pub fn tabs_ui(ui: &mut egui::Ui, selected: usize, views: &[TimelineTab]) -> usi
|
||||
let rect = res.rect;
|
||||
let underline =
|
||||
shrink_range_to_width(rect.x_range(), get_label_width(ui, txt) * 1.15);
|
||||
#[allow(deprecated)]
|
||||
let underline_y = ui.painter().round_to_pixel(rect.bottom()) - 1.5;
|
||||
return (underline, underline_y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user