Open bertsky opened 3 years ago
Fixes #17
Note: 9cfcd81 fixes mouse scroll wheel behaviour. I never got ctrl+scroll zooming to work before (and was surprised to find an implementation). It seems that only the Canvas
is in charge of events (not parent
i.e. Shell
). Also, when I did move the event receiver from parent
to imageCanvas
, I noticed that shift+scroll now did both horizontal and vertical scrolling, hence the extra checking. Plus MOD1
seems less reliable portable to me than CTRL|COMMAND
.
I'll promptly rewrite (and rebase) that part of the PR if you find anything objectionable here.
Strangely, if I export the app as runnable JAR, I get a different behaviour for mouse wheel scrolling than running directly from Eclipse!
When running from Eclipse, ctrl+scroll correctly zooms in or out, depending on the direction. But when running from the runnable JAR, MouseEvent e.count
is always positive, so it always zooms in (regardless of direction). That's despite the fact that count
's sign does yield the correct direction for horizontal or vertical scrolling. (And yes, I have configured the Project JRE
in Eclipse's Run/debug settings
, and the Build path > Libraries
uses the same java-11-openjdk
as my command line invocation.) :confused:
Another strange thing is that in my newly built version, #15 re-appears. My understanding was that this was fixed by https://github.com/PRImA-Research-Lab/prima-page-viewer/commit/ad75ac2dc1b81701f529291bcebdd901d716a455 and https://github.com/PRImA-Research-Lab/prima-core-libs/commit/28db6c09bd7d50dcadebc31a1c67c7c047adf41b.
Since I have not changed the build settings, PrimaDla
is included as a project, and I can see those commits are there.
So perhaps @chris1010010 you used some additional changes for the 1.4.06 binary release that you have not published yet?
Plus the prebuilt version can deal with TIFF images, whereas the configured build cannot.
I have merge in the baseline code
I have merge in the baseline code
Splendid. So how about that part:
Note: 9cfcd81 fixes mouse scroll wheel behaviour. I never got ctrl+scroll zooming to work before (and was surprised to find an implementation). It seems that only the
Canvas
is in charge of events (notparent
i.e.Shell
). Also, when I did move the event receiver fromparent
toimageCanvas
, I noticed that shift+scroll now did both horizontal and vertical scrolling, hence the extra checking. PlusMOD1
seems less ~reliable~ portable to me thanCTRL|COMMAND
.
Plus the prebuilt version can deal with TIFF images, whereas the configured build cannot.
(happens for me e.g. for 16-bit TIFF or grayscale TIFF)
org.eclipse.swt.SWTException: Unsupported color depth
Do you import some additional library for your GH release builds?
No, it's all the same SWT as far as I'm aware. Regarding the mouse scroll, I wanted to test in different OS
No, it's all the same SWT as far as I'm aware.
I see. Then perhaps this is a change between OpenJDK 8 and 11? Or do you use a different JDK8 for your prebuilds?
Regarding the mouse scroll, I wanted to test in different OS
Understood. Did mouse wheel based horizontal/vertical scrolling and zooming work for you so far on any platform? (I've only ever tested Linux 64 bit with OpenJDK 8, and there neither horizontal scrolling nor zooming worked.)
But mind that extra trip of runnable JAR vs running in Eclipse...
This is the bare minimum. You might want to add a new button to switch this on or off. Perhaps Aletheia already has an icon for that?
Also, I had to import
org.primaresearch.dla.page.layout.physical.text.impl.TextLine
, because there is no interface which givesget_Baseline()
.