- bool have_unknown = false;
- bool have_off_diagonal_association = false;
- bool have_diagonal_association = false;
- bool have_diagonal_not_association = false;
-
- for (uint32_t i = 0; i < a->nchannels (); ++i) {
-
- for (uint32_t j = 0; j < b->nchannels (); ++j) {
-
- ARDOUR::BundleChannel c[2];
- c[_matrix->column_index()] = ARDOUR::BundleChannel (a, i);
- c[_matrix->row_index()] = ARDOUR::BundleChannel (b, j);
-
- PortMatrixNode::State const s = _matrix->get_state (c);
-
- switch (s) {
- case PortMatrixNode::ASSOCIATED:
- if (i == j) {
- have_diagonal_association = true;
- } else {
- have_off_diagonal_association = true;
- }
- break;
-
- case PortMatrixNode::UNKNOWN:
- have_unknown = true;
- break;
-
- case PortMatrixNode::NOT_ASSOCIATED:
- if (i == j) {
- have_diagonal_not_association = true;
- }
- break;
+ list<PortMatrixNode> p;
+
+ bool const steep = abs (y1 - y0) > abs (x1 - x0);
+ if (steep) {
+ int tmp = x0;
+ x0 = y0;
+ y0 = tmp;
+
+ tmp = y1;
+ y1 = x1;
+ x1 = tmp;
+ }
+
+ if (x0 > x1) {
+ int tmp = x0;
+ x0 = x1;
+ x1 = tmp;
+
+ tmp = y0;
+ y0 = y1;
+ y1 = tmp;
+ }
+
+ int dx = x1 - x0;
+ int dy = abs (y1 - y0);
+
+ double err = 0;
+ double derr = double (dy) / dx;