sioyek icon indicating copy to clipboard operation
sioyek copied to clipboard

Sioyek only renders top half of each page

Open ChenKB91 opened this issue 1 year ago • 7 comments

My system: image

I'm using version 2.0.0. This is what it looks like when I open the default document: image

Selecting the text puts the highlight at wrong positions. image

I've tried both versions (Appimage and build) on AUR, both have the same issue.

ChenKB91 avatar Feb 20 '24 09:02 ChenKB91

Does the issue happen with the development branch here: https://github.com/ahrm/sioyek/tree/development ? (there are no binaries yet unfortunately, so you'll have to build sioyek from source).

ahrm avatar Feb 20 '24 09:02 ahrm

I'm having some troubles building from the dev branch, it runs into the following error:

pdf_viewer/coordinates.h: In member function ‘float Vec<T, dim>::norm()’:
pdf_viewer/coordinates.h:289:16: error: there are no argumentsto ‘sqrt’ that depend on a template parameter, so a declaration of ‘sqrt’ must be available [-fpermissive]
  289 |         return sqrt(norm_squared);
      |                ^~~~

I'm assuming this is caused by my environment? It seems like the main branch works fine.

ChenKB91 avatar Feb 21 '24 01:02 ChenKB91

Maybe replace this:

  289 |         return sqrt(norm_squared);

with

return sqrt<float>(norm_squared)

ahrm avatar Feb 21 '24 08:02 ahrm

Out of curiosity, are you running this on a virtual machine? Could you try running sioyek like this: LIBGL_ALWAYS_SOFTWARE=1 sioyek?

adriafarres avatar Feb 24 '24 11:02 adriafarres

Out of curiosity, are you running this on a virtual machine? Could you try running sioyek like this: LIBGL_ALWAYS_SOFTWARE=1 sioyek?

I'm running it directly on my laptop. And that flag doesn't seem to effect the appimage version, still only half the page is rendered.

ChenKB91 avatar Feb 26 '24 06:02 ChenKB91

Maybe replace this:

  289 |         return sqrt(norm_squared);

with

return sqrt<float>(norm_squared)

Sorry for the late reply. I've fixed this one by changing sqrt to this->sqrt. But another error appears:

In file included from pdf_viewer/utf8.h:32:
pdf_viewer/utf8/unchecked.h:179:40: warning: ‘template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator’ is deprecated [-Wdeprecated-declarations]
  179 |           class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
      |                                        ^~~~~~~~
/usr/include/c++/13.2.1/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
pdf_viewer/touchui/TouchDrawControls.cpp: In member function ‘void TouchDrawControls::set_scratchpad_mode(bool)’:
pdf_viewer/touchui/TouchDrawControls.cpp:149:30: error: no matching function for call to ‘QMetaObject::invokeMethod(QQuickItem*, const char [26], QVariant)’
  149 |     QMetaObject::invokeMethod(quick_widget->rootObject(), "on_scratchpad_mode_change", QVariant::fromValue(mode));
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I think it is caused by some missing includes, but nothing I add seems to work.

ChenKB91 avatar Feb 26 '24 06:02 ChenKB91

this->sqrt doesn't make any sense. It is not a suitable fix for this issue.

ahrm avatar Feb 26 '24 07:02 ahrm