Optimization: Use constant folding for divisions not a power of two (#9609)

This commit is contained in:
zwim authored and GitHub committed 2022-10-10 22:21:27 +02:00
1 parent a24548ed3f
commit 4969811c08
40 files changed
+118 -118

No files matched your search

@@ -40,8 +40,8 @@ function ReaderPanning:onPanning(args, _)
local dx, dy = unpack(args)
-- for now, bounds checking/calculation is done in the view
self.view:PanningUpdate(
dx * self.panning_steps.normal * self.dimen.w / 100,
dy * self.panning_steps.normal * self.dimen.h / 100)
dx * self.panning_steps.normal * self.dimen.w * (1/100),
dy * self.panning_steps.normal * self.dimen.h * (1/100))
return true
end