Преглед на файлове

Merge pull request #215 from nimble0/fix/box-sizing-drag-resizing

Fix ElementHandle resizing incorrectly when the size_target has "box-sizing: border-box"
Michael R. P. Ragazzon преди 4 години
родител
ревизия
04533bea4e
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      Source/Core/ElementHandle.cpp

+ 4 - 1
Source/Core/ElementHandle.cpp

@@ -94,7 +94,10 @@ void ElementHandle::ProcessDefaultAction(Event& event)
 				move_original_position.y = move_target->GetOffsetTop();
 			}
 			if (size_target)
-				size_original_size = size_target->GetBox().GetSize(Box::CONTENT);
+				size_original_size = size_target->GetBox().GetSize(
+					(size_target->GetComputedValues().box_sizing == Style::BoxSizing::BorderBox)
+					? Box::BORDER
+					: Box::CONTENT);
 		}
 		else if (event == EventId::Drag)
 		{