From f892d4559fe33f356dae05006a966d1c88428f49 Mon Sep 17 00:00:00 2001 From: Jellby Date: Sat, 31 Oct 2020 10:20:02 +0100 Subject: [PATCH] Fix typos --- frontend/apps/reader/modules/readerrolling.lua | 2 +- frontend/apps/reader/modules/readertoc.lua | 2 +- frontend/document/credocument.lua | 2 +- frontend/ui/widget/imagewidget.lua | 4 ++-- frontend/ui/widget/textboxwidget.lua | 10 +++++----- frontend/ui/widget/textwidget.lua | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/apps/reader/modules/readerrolling.lua b/frontend/apps/reader/modules/readerrolling.lua index 359fcc4e7..16d3f9752 100644 --- a/frontend/apps/reader/modules/readerrolling.lua +++ b/frontend/apps/reader/modules/readerrolling.lua @@ -764,7 +764,7 @@ function ReaderRolling:onUpdatePos() -- so updatePos() has good info and can reposition -- the previous xpointer accurately: self.ui.document:getCurrentPos() - -- Otherwise, _readMetadata() would do that, but the positionning + -- Otherwise, _readMetadata() would do that, but the positioning -- would not work as expected, for some reason (it worked -- previously because of some bad setDirty() in ConfigDialog widgets -- that were triggering a full repaint of crengine (so, the needed diff --git a/frontend/apps/reader/modules/readertoc.lua b/frontend/apps/reader/modules/readertoc.lua index f6b379a06..a27ef20f3 100644 --- a/frontend/apps/reader/modules/readertoc.lua +++ b/frontend/apps/reader/modules/readertoc.lua @@ -185,7 +185,7 @@ function ReaderToc:validateAndFixToc() nb_next = nb_next + 1 end end - logger.dbg("BOGUS TOC:", i, page, ">", i-1, cur_page, "-", nb_prev, nb_next) + logger.dbg("BOGUS TOC:", i, page, "<", i-1, cur_page, "-", nb_prev, nb_next) if nb_prev <= nb_next then -- less changes when fixing previous pages local fixed_page if i-nb_prev-1 >= 1 then diff --git a/frontend/document/credocument.lua b/frontend/document/credocument.lua index d92e1a37a..2fc02e920 100644 --- a/frontend/document/credocument.lua +++ b/frontend/document/credocument.lua @@ -1290,7 +1290,7 @@ function CreDocument:setupCallCache() -- gotoXPointer() is for cre internal fixup, we always use gotoPage/Pos -- (goBack, goForward, gotoLink are not used) - -- For some, we prefer no cache (if they costs nothing, return some huge + -- For some, we prefer no cache (if they cost nothing, return some huge -- data that we'd rather not cache, are called with many different args, -- or we'd rather have up to date crengine state) elseif name == "getCurrentPage" then no_wrap = true diff --git a/frontend/ui/widget/imagewidget.lua b/frontend/ui/widget/imagewidget.lua index 810c761f0..eb2c84d7f 100644 --- a/frontend/ui/widget/imagewidget.lua +++ b/frontend/ui/widget/imagewidget.lua @@ -98,7 +98,7 @@ local ImageWidget = Widget:new{ -- Whether to use former blitbuffer:scale() (default to using MuPDF) use_legacy_image_scaling = G_reader_settings:isTrue("legacy_image_scaling"), - -- For initial positionning, if (possibly scaled) image overflows width/height + -- For initial positioning, if (possibly scaled) image overflows width/height center_x_ratio = 0.5, -- default is centered on image's center center_y_ratio = 0.5, @@ -258,7 +258,7 @@ function ImageWidget:_render() end bb_w, bb_h = self._bb:getWidth(), self._bb:getHeight() - -- deal with positionning + -- deal with positioning if self.width and self.height then -- if image is bigger than paint area, allow center_ratio variation -- around 0.5 so we can pan till image border diff --git a/frontend/ui/widget/textboxwidget.lua b/frontend/ui/widget/textboxwidget.lua index db9a6bcfb..b53554948 100644 --- a/frontend/ui/widget/textboxwidget.lua +++ b/frontend/ui/widget/textboxwidget.lua @@ -332,7 +332,7 @@ function TextBoxWidget:_splitToLines() end if line.hard_newline_at_eot and not line.next_start_offset then -- Add an empty line to reprensent the \n at end of text - -- and allow positionning cursor after it + -- and allow positioning cursor after it self.vertical_string_list[ln+1] = { offset = size+1, end_offset = nil, @@ -483,7 +483,7 @@ function TextBoxWidget:_getLinePads(vertical_string) return pads end --- XText: shape a line into positionned glyphs +-- XText: shape a line into positioned glyphs function TextBoxWidget:_shapeLine(line) -- line is an item from self.vertical_string_list if line._shaped then @@ -494,7 +494,7 @@ function TextBoxWidget:_shapeLine(line) -- Empty line (first check above is for hard newline at end of file, -- second check is for hard newline while not at end of file). -- We need to set a direction on this line, so the cursor can be - -- positionned accordingly, on the left or on the right of the line + -- positioned accordingly, on the left or on the right of the line -- (for convenience, we have an empty line inherit the direction -- of the previous line if non-empty) local offset = line.offset @@ -721,7 +721,7 @@ function TextBoxWidget:_shapeLine(line) xglyph.w = xglyph.x1 - xglyph.x0 -- Because of glyph substitution and merging (one to many, many to one, many to many, -- with advance or zero-advance...), glyphs may not always be fine to position - -- the cursor caret. For X/Y/Charpos positionning/guessing, we'll ignore + -- the cursor caret. For X/Y/Charpos positioning/guessing, we'll ignore -- glyphs that are not cluster_start, and we build here the full cluster x0/x1/w -- by merging them from all glyphs part of this cluster if xglyph.is_cluster_start then @@ -732,7 +732,7 @@ function TextBoxWidget:_shapeLine(line) prev_cluster_start_xglyph.w = prev_cluster_start_xglyph.x1 - prev_cluster_start_xglyph.x0 end -- We don't update/decrease prev_cluster_start_xglyph.x0, even if one of its glyph - -- has a backward advance that go back the 1st glyph x0, to not mess positionning. + -- has a backward advance that go back the 1st glyph x0, to not mess positioning. end if xglyph.is_tab then xglyph.no_drawing = true diff --git a/frontend/ui/widget/textwidget.lua b/frontend/ui/widget/textwidget.lua index 40b22b226..c9bbe59c1 100644 --- a/frontend/ui/widget/textwidget.lua +++ b/frontend/ui/widget/textwidget.lua @@ -141,7 +141,7 @@ function TextWidget:updateSize() -- We never need to draw/size more than one screen width, so limit computation -- to that width in case we are given some huge string local tsize = RenderText:sizeUtf8Text(0, Screen:getWidth(), self.face, self._text_to_draw, true, self.bold) - -- As text length includes last glyph pen "advance" (for positionning + -- As text length includes last glyph pen "advance" (for positioning -- 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