[Kst] branches/work/kst/portto4/kst/src/libkstapp
Barth Netterfield
netterfield at astro.utoronto.ca
Wed Apr 27 15:23:33 CEST 2011
SVN commit 1229518 by netterfield:
Fix indexing bug in autoformat.
M +5 -3 formatgridhelper.cpp
M +0 -1 viewgridlayout.cpp
--- branches/work/kst/portto4/kst/src/libkstapp/formatgridhelper.cpp #1229517:1229518
@@ -48,7 +48,7 @@
// count edges that are near this edge
for (int j_edge = 0; j_edge<n_edges; ++j_edge) {
if (edges.at(j_edge).edge_number == -1) {
- if ((edges.at(j_edge).edge >= edges.at(i_edge).edge - 0.00001) &&
+ if ((edges.at(j_edge).edge >= edges.at(i_edge).edge - 0.0001) &&
(edges.at(j_edge).edge <= edges.at(i_edge).edge+grid_resolution)) {
this_edge_count++;
}
@@ -68,14 +68,16 @@
int n_this_edge = 0;
// Set edge_number of all of the edges which are in this area
qreal best_edge = edges.at(i_best_edge).edge;
- for (int i_edge = i_best_edge; i_edge < n_edges; i_edge++) {
- if ((edges.at(i_edge).edge >= best_edge - 0.00001) &&
+ for (int i_edge = 0; i_edge < n_edges; i_edge++) {
+ if (edges.at(i_edge).edge_number == -1) {
+ if ((edges.at(i_edge).edge >= best_edge - 0.0001) &&
(edges.at(i_edge).edge <= best_edge+grid_resolution)) {
edges[i_edge].edge_number = edge_location;
sum_edge += edges.at(i_edge).edge;
++n_this_edge;
}
}
+ }
best_edge = sum_edge/qreal(n_this_edge);
if (n_this_edge != best_edge_count) {
qWarning() << "edge counting error in findNextEdgeLocation()";
--- branches/work/kst/portto4/kst/src/libkstapp/viewgridlayout.cpp #1229517:1229518
@@ -241,7 +241,6 @@
layout->shareAxis(painter, creation);
#endif
- qDebug() << "leave share plots";
}
More information about the Kst
mailing list