aboutsummaryrefslogtreecommitdiff
path: root/data/core
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2021-10-10 21:48:16 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2021-10-10 21:48:16 +0200
commit8b634daa669ac2cf814cc7ec018ef9ddd8c97ec9 (patch)
treec890a91ba4495d52c0281353baa4d0cf5cafcc57 /data/core
parentc7aa3ebe0116b08d16c50e0262f00f8c3dd54601 (diff)
downloadpragtical-8b634daa669ac2cf814cc7ec018ef9ddd8c97ec9.tar.gz
pragtical-8b634daa669ac2cf814cc7ec018ef9ddd8c97ec9.zip
Use rounded value for node's size when splitting
Rouding node's size to an integer value ensure drawing are pixel perfect in sizing.
Diffstat (limited to 'data/core')
-rw-r--r--data/core/rootview.lua9
1 files changed, 1 insertions, 8 deletions
diff --git a/data/core/rootview.lua b/data/core/rootview.lua
index fa200aec..3c4feda0 100644
--- a/data/core/rootview.lua
+++ b/data/core/rootview.lua
@@ -411,15 +411,8 @@ end
-- calculating the sizes is the same for hsplits and vsplits, except the x/y
-- axis are swapped; this function lets us use the same code for both
local function calc_split_sizes(self, x, y, x1, x2, y1, y2)
- local n
local ds = ((x1 and x1 < 1) or (x2 and x2 < 1)) and 0 or style.divider_size
- if x1 then
- n = x1 + ds
- elseif x2 then
- n = self.size[x] - x2
- else
- n = math.floor(self.size[x] * self.divider)
- end
+ local n = math.floor(x1 and x1 + ds or (x2 and self.size[x] - x2 or self.size[x] * self.divider))
self.a.position[x] = self.position[x]
self.a.position[y] = self.position[y]
self.a.size[x] = n - ds