}
}
- _body.repaint_grid ();
+ _body.rebuild_and_draw_grid ();
}
for (std::vector<boost::shared_ptr<ARDOUR::Bundle> >::iterator i = _row_bundles.begin(); i != _row_bundles.end(); ++i) {
_bundle_connections.push_back (
- (*i)->NameChanged.connect (sigc::mem_fun (*this, &PortMatrixBody::repaint_row_labels))
+ (*i)->NameChanged.connect (sigc::mem_fun (*this, &PortMatrixBody::rebuild_and_draw_row_labels))
);
}
for (std::vector<boost::shared_ptr<ARDOUR::Bundle> >::iterator i = _column_bundles.begin(); i != _column_bundles.end(); ++i) {
_bundle_connections.push_back (
- (*i)->NameChanged.connect (sigc::mem_fun (*this, &PortMatrixBody::repaint_column_labels))
+ (*i)->NameChanged.connect (sigc::mem_fun (*this, &PortMatrixBody::rebuild_and_draw_column_labels))
);
}
}
void
-PortMatrixBody::repaint_grid ()
+PortMatrixBody::rebuild_and_draw_grid ()
{
- _grid.require_render ();
+ _grid.require_rebuild ();
queue_draw ();
}
void
-PortMatrixBody::repaint_column_labels ()
+PortMatrixBody::rebuild_and_draw_column_labels ()
{
- _column_labels.require_render ();
+ _column_labels.require_rebuild ();
queue_draw ();
}
void
-PortMatrixBody::repaint_row_labels ()
+PortMatrixBody::rebuild_and_draw_row_labels ()
{
- _row_labels.require_render ();
+ _row_labels.require_rebuild ();
queue_draw ();
}
void set_xoffset (uint32_t);
void set_yoffset (uint32_t);
- void repaint_grid ();
+ void rebuild_and_draw_grid ();
protected:
bool on_expose_event (GdkEventExpose *);
private:
void compute_rectangles ();
- void repaint_column_labels ();
- void repaint_row_labels ();
+ void rebuild_and_draw_column_labels ();
+ void rebuild_and_draw_row_labels ();
PortMatrix* _port_matrix;
PortMatrixColumnLabels _column_labels;
for (uint32_t j = 0; j < (*i)->nchannels(); ++j) {
- double const lc = _longest_channel_name + (2 * name_pad());
- double const lb = _longest_bundle_name + (2 * name_pad());
+ double const lc = _longest_channel_name + name_pad();
double const w = column_width();
if (_location == BOTTOM) {
cairo_move_to (cr, x_, y_);
x_ -= w;
cairo_line_to (cr, x_, y_);
- x_ -= lb * cos (angle());
- y_ += lb * sin (angle());
+ x_ -= lc * cos (angle());
+ y_ += lc * sin (angle());
cairo_line_to (cr, x_, y_);
x_ += w * pow (sin (angle()), 2);
y_ += w * sin (angle()) * cos (angle());
void setup ();
GdkPixmap* get_pixmap (GdkDrawable *);
std::pair<uint32_t, uint32_t> dimensions ();
+
void require_render () {
_render_required = true;
}
+
+ void require_rebuild () {
+ _dimension_computation_required = true;
+ _render_required = true;
+ }
/** @return width of columns in the grid */
static uint32_t column_width () {