Merge pull request #19 from dpavlin/master

fix panning on page in ZOOM_BY_VALUE mode
pull/2/merge
HW 12 years ago
commit 22042f1b09

@ -90,9 +90,11 @@ lfs.o: $(LFSDIR)/src/lfs.c
$(CC) -c $(CFLAGS) -I$(LUADIR)/src -I$(LFSDIR)/src $(LFSDIR)/src/lfs.c -o $@
fetchthirdparty:
-rmdir mupdf
-rmdir lua
-rm lua
-rm -Rf mupdf
-rm -Rf lua lua-5.1.4*
-rm -Rf lsqlite3_svn08*
-rm -Rf sqlite-amalgamation-3070900*
-rm -Rf luafilesystem*
git clone git://git.ghostscript.com/mupdf.git
( cd mupdf ; wget http://www.mupdf.com/download/mupdf-thirdparty.zip && unzip mupdf-thirdparty.zip )
wget http://www.lua.org/ftp/lua-5.1.4.tar.gz && tar xvzf lua-5.1.4.tar.gz && ln -s lua-5.1.4 lua

@ -115,7 +115,7 @@ function set_emu_keycodes()
KEY_FW_DOWN = 116
KEY_FW_LEFT = 113
KEY_FW_RIGHT = 114
KEY_FW_PRESS = 36 -- enter for now
KEY_FW_PRESS = 115 -- end for now (above arrows)
KEY_SPACE = 65
KEY_ENTER = 36

@ -437,8 +437,8 @@ function PDFReader:inputloop()
x = self.shift_x / 5
y = self.shift_y / 5
elseif self.pan_by_page then
x = self.width - 5; -- small overlap when moving by page
y = self.height - 5;
x = width - 5; -- small overlap when moving by page
y = height - 5;
else
x = self.shift_x
y = self.shift_y
@ -453,11 +453,17 @@ function PDFReader:inputloop()
if self.offset_x > 0 then
self.offset_x = 0
end
if self.pan_by_page then
self.offset_y = 0
end
elseif ev.code == KEY_FW_RIGHT then
self.offset_x = self.offset_x - x
if self.offset_x < self.min_offset_x then
self.offset_x = self.min_offset_x
end
if self.pan_by_page then
self.offset_y = 0
end
elseif ev.code == KEY_FW_UP then
self.offset_y = self.offset_y + y
if self.offset_y > 0 then

Loading…
Cancel
Save