Summary: | Minor ticks for log-mode reversed axis are drawn incorrectly | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Andrew Walker <arwalker> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Andrew Walker
2006-06-13 23:17:01 UTC
SVN commit 551183 by arwalker: BUG:129109 Correctly handle minor tick marks for log-mode and reversed axis (both x and y) M +20 -12 kst2dplot.cpp --- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.cpp #551182:551183 @@ -5590,22 +5590,26 @@ // draw x-ticks if (_xLog) { + double XPos; + i = (int)floor((double)_xMajorTicks*(xleft_bdr_px - 1.0 - x_orig_px)/xtick_px); for (;xtick_px * i + x_orig_px < x_px - xright_bdr_px + 1; i++) { // draw major ticks X1 = (x_orig_px + double(i) * xtick_px); if (_xReversed) { - X1 = x_px - xright_bdr_px - (X1 - xleft_bdr_px); + XPos = x_px - xright_bdr_px - (X1 - xleft_bdr_px); + } else { + XPos = X1; } - if (X1 > xleft_bdr_px && X1 < x_px - xright_bdr_px) { - p.drawLine(d2i(X1), + if (XPos > xleft_bdr_px && XPos < x_px - xright_bdr_px) { + p.drawLine(d2i(XPos), xMajorTopTickTop, - d2i(X1), + d2i(XPos), xMajorTopTickBottom); - p.drawLine(d2i(X1), + p.drawLine(d2i(XPos), xMajorBottomTickBottom, - d2i(X1), + d2i(XPos), xMajorBottomTickTop); } @@ -5659,22 +5663,26 @@ // draw y ticks if (_yLog) { + double YPos; + i = (int)floor( (double)_yMajorTicks * ( ytop_bdr_px - 1.0 - y_orig_px ) / ytick_px ); for (; ytick_px * i + y_orig_px < y_px - ybot_bdr_px + 1; i++) { // draw major ticks Y1 = y_orig_px + (double)i * ytick_px; if (_yReversed) { - Y1 = y_px - ybot_bdr_px - (Y1 - ytop_bdr_px); + YPos = y_px - ybot_bdr_px - (Y1 - ytop_bdr_px); + } else { + YPos = Y1; } - if (Y1 > ytop_bdr_px) { + if (YPos > ytop_bdr_px && YPos < y_px - ybot_bdr_px) { p.drawLine(yMajorLeftTickLeft, - d2i(Y1), + d2i(YPos), yMajorLeftTickRight, - d2i(Y1)); + d2i(YPos)); p.drawLine(yMajorRightTickRight, - d2i(Y1), + d2i(YPos), yMajorRightTickLeft, - d2i(Y1)); + d2i(YPos)); } // draw minor ticks |