Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug_ui: Add horizontal & vertical scroll to EditText #19026

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions core/src/debug_ui/display_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use egui::{
};
use ruffle_wstr::{WStr, WString};
use std::borrow::Cow;
use std::ops::RangeInclusive;
use swf::{Color, ColorTransform, Fixed8, Rectangle, Twips};

const DEFAULT_DEBUG_COLORS: [[f32; 3]; 10] = [
Expand Down Expand Up @@ -424,6 +425,37 @@ impl DisplayObjectWindow {
});
ui.end_row();

ui.label("H Scroll");
ui.horizontal(|ui| {
let max = object.maxhscroll();
let mut hscroll = object.hscroll();
DragValue::new(&mut hscroll)
.suffix("px")
.range(RangeInclusive::new(0.0, max))
.ui(ui);
ui.weak(format!("(max {}px)", max));

if hscroll != object.hscroll() {
object.set_hscroll(hscroll, context);
}
});
ui.end_row();

ui.label("V Scroll");
ui.horizontal(|ui| {
let max = object.maxscroll();
let mut scroll = object.scroll();
DragValue::new(&mut scroll)
.range(RangeInclusive::new(1, max))
.ui(ui);
ui.weak(format!("(max {})", max));

if scroll != object.scroll() {
object.set_scroll(scroll as f64, context);
}
});
ui.end_row();

ui.label("Autosize");
ui.horizontal(|ui| {
let mut autosize = object.autosize();
Expand Down