diff --git a/src/WinWebDiffLib/DiffLocation.hpp b/src/WinWebDiffLib/DiffLocation.hpp index aee3368..dfd9401 100644 --- a/src/WinWebDiffLib/DiffLocation.hpp +++ b/src/WinWebDiffLib/DiffLocation.hpp @@ -124,7 +124,7 @@ class DiffLocation rect.top = diffRect.top; rect.width = diffRect.width; rect.height = diffRect.height; - for (int containerId = diffRect.containerId; containerId != -1; ) + for (int containerId = diffRect.containerId; containerId > 0; ) { const ContainerRect& containerRect = m_containerRects[window][containerId]; if (containerRect.id == 0 && (containerRect.width == 0 || containerRect.height == 0)) @@ -132,8 +132,11 @@ class DiffLocation clip(rect, containerRect); containerId = containerRect.containerId; } - rect.left += m_scrollX; - rect.top += m_scrollY; + if (rect.left != -99999.9f || rect.top != -99999.9f) + { + rect.left += m_scrollX; + rect.top += m_scrollY; + } if (!window.empty()) { calcGlobalPosition(rect, window);