[MIRROR] Avoid resizing chat to nothing in the Fit Viewport verb (#646)

* Avoid resizing chat to nothing in the Fit Viewport verb (#53393)

* Avoid resizing chat to nothing in the Fit Viewport verb

Co-authored-by: Tad Hardesty <tad@platymuus.com>
This commit is contained in:
SkyratBot
2020-09-06 05:13:04 +02:00
committed by GitHub
co-authored by Tad Hardesty
parent a57b592fe5
commit 7c8de9b945
+3
View File
@@ -339,6 +339,9 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
var/split_size = splittext(sizes["mainwindow.split.size"], "x")
var/split_width = text2num(split_size[1])
// Avoid auto-resizing the statpanel and chat into nothing.
desired_width = min(desired_width, split_width - 300)
// Calculate and apply a best estimate
// +4 pixels are for the width of the splitter's handle
var/pct = 100 * (desired_width + 4) / split_width