Fixed minor bugs in Ruler; added ASSERT_INDEX macro - an ArrayCtrl column integrity check

git-svn-id: svn://ultimatepp.org/upp/trunk@696 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
rylek 2008-12-08 07:41:19 +00:00
parent 81a749cf59
commit 0bc12c910c
2 changed files with 4 additions and 2 deletions

View file

@ -222,7 +222,7 @@ void RulerCtrl::Paint(Draw& draw)
enum {
SMALL_LIMIT = 100,
TEXT_LIMIT = 50,
// TEXT_LIMIT = 50,
TGAP = 3,
HGAP = 2,
VGAP = 0,
@ -261,7 +261,7 @@ void RulerCtrl::Paint(Draw& draw)
rep_count = ceil(pos2 / text_repeat) - floor(pos1 / text_repeat) + 1;
}
if(!text_step.IsEmpty() && (!text_value.IsEmpty() || text_convert)
&& rep_count > 0 && rep_count * text_step.GetCount() <= TEXT_LIMIT) {
&& rep_count > 0 /*&& rep_count * text_step.GetCount() <= TEXT_LIMIT*/) {
int ix = BinFindIndex(text_step, pos1 - rep_index * text_repeat);
int ppos = (is_right ? SMALL_SIZE : cheight - cy - SMALL_SIZE);
for(int c = fround(rep_count); --c >= 0; ix = 0, rep_index++) {

View file

@ -1,5 +1,7 @@
NAMESPACE_UPP
#define ASSERT_INDEX(arrayctrl, index) ASSERT(arrayctrl.GetIndexCount() == index)
#define TOOL(x) \
void COMBINE(Tool, x)(Bar& bar); \
void COMBINE(On, x)(); \