From 8729d14c7ab230aab5bf54dfab5f13e33d2255d8 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Tue, 11 Jul 2017 21:56:42 +0800 Subject: [PATCH] fix bug that place margin would generate bad value --- source/gui/place_parts.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/gui/place_parts.hpp b/source/gui/place_parts.hpp index 3dde6ca9..4511dc95 100644 --- a/source/gui/place_parts.hpp +++ b/source/gui/place_parts.hpp @@ -557,7 +557,10 @@ namespace nana }value_; };//end class number_t - + /// Margin attribute + /** + * Definition at https://github.com/cnjinhao/nana/wiki/Div-Text#margin + */ class margin { public: @@ -598,7 +601,7 @@ namespace nana { case 0: break; case 1: //top - il = ir = it = ib = 0; + it = 0; break; case 2://top,bottom and left,right it = ib = 0; @@ -624,7 +627,7 @@ namespace nana case 3: //left pos = il; break; default: - return number_t{}; + return {}; } return (-1 == pos ? number_t{} : margins_[pos]); @@ -652,7 +655,7 @@ namespace nana { case 0: break; case 1: //top - il = ir = it = ib = 0; + it = 0; break; case 2://top,bottom and left,right it = ib = 0;