mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Optimization: Use constant folding for divisions not a power of two (#9609)
This commit is contained in:
@@ -433,10 +433,10 @@ function ReaderMenu:_getTabIndexFromLocation(ges)
|
||||
if not ges then
|
||||
return self.last_tab_index
|
||||
-- if the start position is far right
|
||||
elseif ges.pos.x > 2 * Screen:getWidth() / 3 then
|
||||
elseif ges.pos.x > Screen:getWidth() * (2/3) then
|
||||
return BD.mirroredUILayout() and 1 or #self.tab_item_table
|
||||
-- if the start position is far left
|
||||
elseif ges.pos.x < Screen:getWidth() / 3 then
|
||||
elseif ges.pos.x < Screen:getWidth() * (1/3) then
|
||||
return BD.mirroredUILayout() and #self.tab_item_table or 1
|
||||
-- if center return the last index
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user