summaryrefslogtreecommitdiff
path: root/src/Fl_Scroll.cxx
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 18:12:40 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 18:12:40 +0500
commitb4995f979d127cea667b4e2b71c91e9db4ab52ef (patch)
treefbebc775e10932bace8d6a7c3481b1ba200c64db /src/Fl_Scroll.cxx
parent9575eb0a1ffa8150f70f88b5f6b55f342c3c0088 (diff)
wip
Diffstat (limited to 'src/Fl_Scroll.cxx')
-rw-r--r--src/Fl_Scroll.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx
index f64dbb952..951d5daae 100644
--- a/src/Fl_Scroll.cxx
+++ b/src/Fl_Scroll.cxx
@@ -169,7 +169,8 @@ void Fl_Scroll::draw_clip(void* v,int X, int Y, int W, int H) {
// draw visible children
Fl_Widget*const* a = s->array();
- for (int i=s->children()-2; i--;) {
+ int i;
+ for (i =s->children()-2; i--;) {
Fl_Widget& o = **a++;
s->draw_child(o);
s->draw_outside_label(o);
@@ -208,7 +209,8 @@ void Fl_Scroll::recalc_scrollbars(ScrollInfo &si) const {
si.child.t = si.innerbox.y;
int first = 1;
Fl_Widget*const* a = array();
- for (int i=children(); i--;) {
+ int i;
+ for (i =children(); i--;) {
Fl_Widget* o = *a++;
if ( o==&scrollbar || o==&hscrollbar || o->visible()==0 ) continue;
if ( first ) {
@@ -340,6 +342,7 @@ void Fl_Scroll::draw() {
draw_box(box(),x(),y(),w(),h(),color());
draw_clip(this, X, Y, W, H);
} else {
+ int i;
if (d & FL_DAMAGE_SCROLL) {
// scroll the contents:
fl_scroll(X, Y, W, H, oldx-xposition_, oldy-yposition_, draw_clip, this);
@@ -351,7 +354,7 @@ void Fl_Scroll::draw() {
R = 0;
T = 999999;
B = 0;
- for (int i=children()-2; i--; a++) {
+ for (i =children()-2; i--; a++) {
if ((*a)->x() < L) L = (*a)->x();
if (((*a)->x() + (*a)->w()) > R) R = (*a)->x() + (*a)->w();
if ((*a)->y() < T) T = (*a)->y();
@@ -365,7 +368,7 @@ void Fl_Scroll::draw() {
if (d & FL_DAMAGE_CHILD) { // draw damaged children
fl_push_clip(X, Y, W, H);
Fl_Widget*const* a = array();
- for (int i=children()-2; i--;) update_child(**a++);
+ for (i =children()-2; i--;) update_child(**a++);
fl_pop_clip();
}
}
@@ -454,7 +457,8 @@ void Fl_Scroll::resize(int X, int Y, int W, int H) {
fix_scrollbar_order();
// move all the children:
Fl_Widget*const* a = array();
- for (int i=children()-2; i--;) {
+ int i;
+ for (i =children()-2; i--;) {
Fl_Widget* o = *a++;
o->position(o->x()+dx, o->y()+dy);
}
@@ -493,7 +497,8 @@ void Fl_Scroll::scroll_to(int X, int Y) {
xposition_ = X;
yposition_ = Y;
Fl_Widget*const* a = array();
- for (int i=children(); i--;) {
+ int i;
+ for (i =children(); i--;) {
Fl_Widget* o = *a++;
if (o == &hscrollbar || o == &scrollbar) continue;
o->position(o->x()+dx, o->y()+dy);