mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Various minor fixes (#4172)
- css tweaks: use correct CSS "hyphens:" instead of "hyphenate:" - screenshoter: more logical order of lines (no change in what it does) - textviewer: make diagonal swipe really trigger a full refresh - textwidget: more adequate text length to help with centering - toggleswitch: fix sizing & centering with correct calculations (this reduces a bit the size of switches, and may cause a new truncation in some translations)
This commit is contained in:
@@ -46,7 +46,11 @@ function TextWidget:updateSize()
|
||||
if not tsize then
|
||||
self._length = 0
|
||||
else
|
||||
self._length = math.ceil(tsize.x)
|
||||
-- As text length includes last glyph pen "advance" (for positionning
|
||||
-- next char), it's best to use math.floor() instead of math.ceil()
|
||||
-- to get rid of a fraction of it in case this text is to be
|
||||
-- horizontally centered
|
||||
self._length = math.floor(tsize.x)
|
||||
end
|
||||
-- Used to be:
|
||||
-- self._height = math.ceil(self.face.size * 1.5)
|
||||
|
||||
Reference in New Issue
Block a user