Canvas: change API of Item::child_changed() to include bool indicate bounding_box change
This commit is contained in:
parent
d6fa458f3b
commit
fc9840f2a9
|
@ -61,7 +61,7 @@ public:
|
||||||
double top_padding, right_padding, bottom_padding, left_padding;
|
double top_padding, right_padding, bottom_padding, left_padding;
|
||||||
double top_margin, right_margin, bottom_margin, left_margin;
|
double top_margin, right_margin, bottom_margin, left_margin;
|
||||||
|
|
||||||
void child_changed ();
|
void child_changed (bool bbox_changed);
|
||||||
private:
|
private:
|
||||||
struct ChildInfo {
|
struct ChildInfo {
|
||||||
Item* item;
|
Item* item;
|
||||||
|
|
|
@ -226,7 +226,7 @@ public:
|
||||||
void raise_child_to_top (Item *);
|
void raise_child_to_top (Item *);
|
||||||
void raise_child (Item *, int);
|
void raise_child (Item *, int);
|
||||||
void lower_child_to_bottom (Item *);
|
void lower_child_to_bottom (Item *);
|
||||||
virtual void child_changed ();
|
virtual void child_changed (bool bbox_changed);
|
||||||
|
|
||||||
static int default_items_per_cell;
|
static int default_items_per_cell;
|
||||||
|
|
||||||
|
|
|
@ -353,11 +353,11 @@ Grid::place (Item* i, double x, double y, double col_span, double row_span)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Grid::child_changed ()
|
Grid::child_changed (bool bbox_changed)
|
||||||
{
|
{
|
||||||
/* catch visibility and size changes */
|
/* catch visibility and size changes */
|
||||||
|
|
||||||
Item::child_changed ();
|
Item::child_changed (bbox_changed);
|
||||||
reposition_children ();
|
reposition_children ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,9 +278,8 @@ Item::set_position (Duple p)
|
||||||
if (visible()) {
|
if (visible()) {
|
||||||
_canvas->item_moved (this, pre_change_parent_bounding_box);
|
_canvas->item_moved (this, pre_change_parent_bounding_box);
|
||||||
|
|
||||||
|
|
||||||
if (_parent) {
|
if (_parent) {
|
||||||
_parent->child_changed ();
|
_parent->child_changed (false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,7 +377,7 @@ Item::propagate_show_hide ()
|
||||||
/* bounding box may have changed while we were hidden */
|
/* bounding box may have changed while we were hidden */
|
||||||
|
|
||||||
if (_parent) {
|
if (_parent) {
|
||||||
_parent->child_changed ();
|
_parent->child_changed (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
_canvas->item_shown_or_hidden (this);
|
_canvas->item_shown_or_hidden (this);
|
||||||
|
@ -640,7 +639,7 @@ Item::end_change ()
|
||||||
_canvas->item_changed (this, _pre_change_bounding_box);
|
_canvas->item_changed (this, _pre_change_bounding_box);
|
||||||
|
|
||||||
if (_parent) {
|
if (_parent) {
|
||||||
_parent->child_changed ();
|
_parent->child_changed (_pre_change_bounding_box != _bounding_box);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1061,13 +1060,13 @@ Item::invalidate_lut () const
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Item::child_changed ()
|
Item::child_changed (bool bbox_changed)
|
||||||
{
|
{
|
||||||
invalidate_lut ();
|
invalidate_lut ();
|
||||||
_bounding_box_dirty = true;
|
_bounding_box_dirty = bbox_changed;
|
||||||
|
|
||||||
if (_parent) {
|
if (_parent) {
|
||||||
_parent->child_changed ();
|
_parent->child_changed (bbox_changed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user