fix bug that place margin would generate bad value

This commit is contained in:
Jinhao 2017-07-11 21:56:42 +08:00
parent 255f5851c6
commit 8729d14c7a

View File

@ -557,7 +557,10 @@ namespace nana
}value_; }value_;
};//end class number_t };//end class number_t
/// Margin attribute
/**
* Definition at https://github.com/cnjinhao/nana/wiki/Div-Text#margin
*/
class margin class margin
{ {
public: public:
@ -598,7 +601,7 @@ namespace nana
{ {
case 0: break; case 0: break;
case 1: //top case 1: //top
il = ir = it = ib = 0; it = 0;
break; break;
case 2://top,bottom and left,right case 2://top,bottom and left,right
it = ib = 0; it = ib = 0;
@ -624,7 +627,7 @@ namespace nana
case 3: //left case 3: //left
pos = il; break; pos = il; break;
default: default:
return number_t{}; return {};
} }
return (-1 == pos ? number_t{} : margins_[pos]); return (-1 == pos ? number_t{} : margins_[pos]);
@ -652,7 +655,7 @@ namespace nana
{ {
case 0: break; case 0: break;
case 1: //top case 1: //top
il = ir = it = ib = 0; it = 0;
break; break;
case 2://top,bottom and left,right case 2://top,bottom and left,right
it = ib = 0; it = ib = 0;