Skip to content

Commit

Permalink
debug_ui: Add horizontal & vertical scroll to EditText
Browse files Browse the repository at this point in the history
  • Loading branch information
kjarosh committed Jan 12, 2025
1 parent 0705f8b commit b18472e
Showing 1 changed file with 32 additions and 0 deletions.
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

0 comments on commit b18472e

Please sign in to comment.