Describe Cell width as a narrow/wide boolean.

A character cell can only be either narrow or wide.  It's more
convenient to represent that as an int containing 1 or 2, but slightly
more correct to represent it as a "boolean" single-bit integer.
This commit is contained in:
John Hood
2016-11-15 21:18:18 -05:00
committed by john hood
parent 71fe4441ef
commit 302c7deb41
4 changed files with 14 additions and 13 deletions
+5 -5
View File
@@ -41,14 +41,14 @@ using namespace Terminal;
Cell::Cell( color_type background_color )
: contents(),
renditions( background_color ),
width( 1 ),
wide( false ),
fallback( false ),
wrap( false )
{}
Cell::Cell() /* default constructor required by C++11 STL */
: contents(),
renditions( 0 ),
width( 1 ),
wide( false ),
fallback( false ),
wrap( false )
{
@@ -59,7 +59,7 @@ void Cell::reset( color_type background_color )
{
contents.clear();
renditions = Renditions( background_color );
width = 1;
wide = false;
fallback = false;
wrap = false;
}
@@ -642,10 +642,10 @@ bool Cell::compare( const Cell &other ) const
fallback, other.fallback );
}
if ( width != other.width ) {
if ( wide != other.wide ) {
ret = true;
fprintf( stderr, "width: %d vs. %d\n",
width, other.width );
wide, other.wide );
}
if ( !(renditions == other.renditions) ) {