diff --git a/lib/wibox/container/place.lua b/lib/wibox/container/place.lua index 364afed5..6956d12d 100644 --- a/lib/wibox/container/place.lua +++ b/lib/wibox/container/place.lua @@ -23,13 +23,8 @@ local align_fct = { } align_fct.top, align_fct.bottom = align_fct.left, align_fct.right --- Layout this layout -function place:layout(context, width, height) - - if not self._private.widget then - return - end - +-- Shared with some subclasses like the `tiled` and `scaled` modules. +function place:_layout(context, width, height) local w, h = base.fit_widget(self, context, self._private.widget, width, height) if self._private.content_fill_horizontal then @@ -45,6 +40,21 @@ function place:layout(context, width, height) local x, y = align_fct[halign](w, width), align_fct[valign](h, height) + -- Sub pixels makes everything blurry. This is now what people expect. + x, y = math.floor(x), math.floor(y) + + return x, y, w, h +end + +-- Layout this layout +function place:layout(context, width, height) + + if not self._private.widget then + return + end + + local x, y, w, h = self:_layout(context, width, height) + return { base.place_widget_at(self._private.widget, x, y, w, h) } end