Add the possibility to draw double lines on overlapped flat lines for the 8x16graph font

This commit is contained in:
Markus Gans 2015-06-22 00:26:24 +02:00
parent 215f213bad
commit 7d6169fb26
1 changed files with 26 additions and 25 deletions

View File

@ -72,10 +72,10 @@ FWidget::FWidget (FWidget* parent) : FObject(parent)
this->ymin = parent->client_ymin; this->ymin = parent->client_ymin;
this->xmax = parent->client_xmax; this->xmax = parent->client_xmax;
this->ymax = parent->client_ymax; this->ymax = parent->client_ymax;
double_flatline_mask.top.resize (width, false); double_flatline_mask.top.resize (uLong(width), false);
double_flatline_mask.right.resize (height, false); double_flatline_mask.right.resize (uLong(height), false);
double_flatline_mask.bottom.resize (width, false); double_flatline_mask.bottom.resize (uLong(width), false);
double_flatline_mask.left.resize (height, false); double_flatline_mask.left.resize (uLong(height), false);
} }
} }
@ -132,10 +132,10 @@ void FWidget::init()
width, height ); width, height );
adjustWidgetSizeGlobalShadow = adjustWidgetSizeGlobal; adjustWidgetSizeGlobalShadow = adjustWidgetSizeGlobal;
double_flatline_mask.top.resize (width, false); double_flatline_mask.top.resize (uLong(width), false);
double_flatline_mask.right.resize (height, false); double_flatline_mask.right.resize (uLong(height), false);
double_flatline_mask.bottom.resize (width, false); double_flatline_mask.bottom.resize (uLong(width), false);
double_flatline_mask.left.resize (height, false); double_flatline_mask.left.resize (uLong(height), false);
// default widget colors // default widget colors
setColorTheme(); setColorTheme();
@ -1176,10 +1176,10 @@ void FWidget::resize()
} }
else else
adjustSize(); adjustSize();
double_flatline_mask.top.resize (width, false); double_flatline_mask.top.resize (uLong(width), false);
double_flatline_mask.right.resize (height, false); double_flatline_mask.right.resize (uLong(height), false);
double_flatline_mask.bottom.resize (width, false); double_flatline_mask.bottom.resize (uLong(width), false);
double_flatline_mask.left.resize (height, false); double_flatline_mask.left.resize (uLong(height), false);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -1445,8 +1445,8 @@ void FWidget::setWidth (int w, bool adjust)
if ( adjust ) if ( adjust )
adjustSize(); adjustSize();
double_flatline_mask.top.resize (width, false); double_flatline_mask.top.resize (uLong(width), false);
double_flatline_mask.bottom.resize (width, false); double_flatline_mask.bottom.resize (uLong(width), false);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -1466,8 +1466,8 @@ void FWidget::setHeight (int h, bool adjust)
if ( adjust ) if ( adjust )
adjustSize(); adjustSize();
double_flatline_mask.right.resize (height, false); double_flatline_mask.right.resize (uLong(height), false);
double_flatline_mask.left.resize (height, false); double_flatline_mask.left.resize (uLong(height), false);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -1592,10 +1592,10 @@ void FWidget::setGeometry (int x, int y, int w, int h, bool adjust)
if ( adjust ) if ( adjust )
adjustSize(); adjustSize();
double_flatline_mask.top.resize (width, false); double_flatline_mask.top.resize (uLong(width), false);
double_flatline_mask.right.resize (height, false); double_flatline_mask.right.resize (uLong(height), false);
double_flatline_mask.bottom.resize (width, false); double_flatline_mask.bottom.resize (uLong(width), false);
double_flatline_mask.left.resize (height, false); double_flatline_mask.left.resize (uLong(height), false);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -1893,7 +1893,7 @@ void FWidget::drawFlatBorder()
for (int y=0; y < height; y++) for (int y=0; y < height; y++)
{ {
gotoxy (x1-1, y1+y+1); gotoxy (x1-1, y1+y+1);
if ( double_flatline_mask.left[y] ) if ( double_flatline_mask.left[uLong(y)] )
print (fc::NF_rev_border_line_right); // || is not yet defined print (fc::NF_rev_border_line_right); // || is not yet defined
else else
print (fc::NF_rev_border_line_right); // right line (on left side) print (fc::NF_rev_border_line_right); // right line (on left side)
@ -1902,7 +1902,7 @@ void FWidget::drawFlatBorder()
gotoxy (x2, y1+1); gotoxy (x2, y1+1);
for (int y=0; y < height; y++) for (int y=0; y < height; y++)
{ {
if ( double_flatline_mask.right[y] ) if ( double_flatline_mask.right[uLong(y)] )
print (fc::NF_border_line_left); // || is not yet defined print (fc::NF_border_line_left); // || is not yet defined
else else
print (fc::NF_border_line_left); // left line (on right side) print (fc::NF_border_line_left); // left line (on right side)
@ -1912,7 +1912,7 @@ void FWidget::drawFlatBorder()
gotoxy (x1, y1); gotoxy (x1, y1);
for (int x=0; x < width; x++) for (int x=0; x < width; x++)
{ {
if ( double_flatline_mask.top[x] ) if ( double_flatline_mask.top[uLong(x)] )
print (fc::NF_border_line_up_and_down); // top+bottom line (at top) print (fc::NF_border_line_up_and_down); // top+bottom line (at top)
else else
print (fc::NF_border_line_bottom); // bottom line (at top) print (fc::NF_border_line_bottom); // bottom line (at top)
@ -1921,7 +1921,7 @@ void FWidget::drawFlatBorder()
gotoxy (x1, y2); gotoxy (x1, y2);
for (int x=0; x < width; x++) for (int x=0; x < width; x++)
{ {
if ( double_flatline_mask.bottom[x] ) if ( double_flatline_mask.bottom[uLong(x)] )
print (fc::NF_border_line_up_and_down); // top+bottom line (at bottom) print (fc::NF_border_line_up_and_down); // top+bottom line (at bottom)
else else
print (fc::NF_border_line_upper); // top line (at bottom) print (fc::NF_border_line_upper); // top line (at bottom)
@ -1967,7 +1967,7 @@ void FWidget::clearFlatBorder()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::setDoubleFlatLine(int side, bool bit) void FWidget::setDoubleFlatLine(int side, bool bit)
{ {
int size; uLong size;
assert ( side == fc::top assert ( side == fc::top
|| side == fc::right || side == fc::right
@ -1997,6 +1997,7 @@ void FWidget::setDoubleFlatLine(int side, bool bit)
break; break;
} }
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::vector<bool>& FWidget::doubleFlatLine_ref(int side) std::vector<bool>& FWidget::doubleFlatLine_ref(int side)
{ {