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

Bug 1385: Failure when displaying hint on floating toolbar

https://winscp.net/tracker/1385

Source commit: e9e82a854a93526be3c446145987ff2efbbc656e
Martin Prikryl преди 9 години
родител
ревизия
dc8f74ff4e
променени са 1 файла, в които са добавени 11 реда и са изтрити 3 реда
  1. 11 3
      source/packages/my/PasTools.pas

+ 11 - 3
source/packages/my/PasTools.pas

@@ -277,9 +277,17 @@ begin
   // RTL_COPY (TCustomForm.ReadState)
   Form := ValidParentForm(Control);
   TextHeight := Form.RetrieveTextHeight;
-  // that's our design text-size, we do not expect any other value
-  Assert(TextHeight = OurDesignTimeTextHeight);
-  Result := ScaleByTextHeightImpl(Control, Dimension, TextHeight);
+  // runtime form (such as TTBFloatingWindowParent)
+  if TextHeight = 0 then
+  begin
+    Result := ScaleByTextHeightRunTime(Control, Dimension);
+  end
+    else
+  begin
+    // that's our design text-size, we do not expect any other value
+    Assert(TextHeight = OurDesignTimeTextHeight);
+    Result := ScaleByTextHeightImpl(Control, Dimension, TextHeight);
+  end;
 end;
 
 // this differs from ScaleByTextHeight only by enforcing