|Anonymous | Login | Signup for a new account||2019-04-22 07:10 CEST|
|Main | My View | View Issues | Change Log | Roadmap | Docs|
|Viewing Issue Simple Details|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0005996||[JEDI VCL] 00 JVCL Components||major||always||2012-10-01 20:54||2015-09-14 13:20|
|Summary||0005996: Problems with scrolling JvPrvwDoc (TJvPreviewControl)|
TJvPreviewControl's scrolling has several shortcomings:
* Scrolling increments are based on the printed page size, so scrolling while zoomed in results in very large jumps in the visible page.
* Mouse wheel support doesn't honor the user's chosen settings for how fast the wheel scrolls.
* The scroll bar's thumb buttons aren't proportional to the visible area.
* There's no distinction between scrolling a page at a time and scrolling a line at a time.
Attached is a patch to fix these problems. A description of the patch's logic:
Set SCROLLINFO.nPage so that thumb button size is proportional.
Adjust values for nMax. The new values for nMax and nPage are based on the "Remarks" section of MSDN's SetScrollInfo documentation (http://msdn.microsoft.com/en-us/library/windows/desktop/bb787595%28v=vs.85%29.aspx). [^]
Use FMaxHeight - 1 and FMaxWidth - 1 for SCROLLINFO.nMax. (Since scrolling is in the range [ nMin, nMax ], and we use 0 for nMin, I believe we need to subtract 1 for nMax.)
Comment out ScrollBy call; it's redundant with SetScrollInfo.
Old code scrolled by 1/3 of an on-paper page, always. New code scrolls by 50 pixels for line at a time (value chosen because that's what Mozilla Firefox uses) or one screenful at a time, as expected.
Mouse wheel logic is based on http://msdn.microsoft.com/en-us/library/ms997498.aspx. [^]
120 (mouse wheel delta) should be a constant somewhere, but I'm not sure where the JVCL keeps constants like this.
The scroll increment for horizontal scrolling should be updated to be similar to the scroll increment for vertical scrolling. My app doesn't make much use of horizontal scrolling of TJvPreviewControl, so I haven't yet done this.
|Tags||No tags attached.|
jvprvwdocscrolling.diff [^] (5,408 bytes) 2012-10-01 20:54
PreviewDemo.zip [^] (82,497 bytes) 2013-07-19 18:48
|Thanks for this, could you provide the zipped sources of a sample application showing the result of this?|
Sorry for taking so long to get back to you regarding this.
I've attached a demo of the preview control as we're using it. Here are some specific operations that work better with my patch:
* The size of the scroll bar's thumb button is proportional to what's visible on the screen.
* It honors Windows' settings on whether the mouse wheel should scroll N lines or page at a time. (The old version scrolls one third of a page regardless of mouse wheel setting.)
* Scrolling one line (by clicking the scroll bar's arrow buttons) was treated identically to scrolling one page (by clicking the empty space on the scroll bar).
* Scrolling is smoother. To demonstrate, zoom in by clicking the "Fit page width button" (this is 226% zoom on my monitor) and scroll by slowly dragging the thumb button up and down; in the old version, the scrolling motion is very jittery (bounces back and forth some).
* There was screen flicker when scrolling - e.g., at default settings (100%), try rapidly scrolling back and forth with mouse wheel and look for the black and gray page breaks flickering during a scroll operation. (I think that this is another example of the previous fix).
* If the zoom level is set high enough that a horizontal scroll bar would be shown (e.g., 300%), then clicking the scroll down button didn't work, and scrolling one line at a time (for example, by clicking the scroll up button) jumped a third of the printed page (which is more than is even visible on the screen). (This particular bug isn't fixed in this patch but is in my GitHub pull request.)
* The patch adds better support for wheel delta varying from its default of 120 - see http://msdn.microsoft.com/en-us/library/windows/desktop/ms645617%28v=vs.85%29.aspx. [^]
I submitted a pull request with the current version of the bug fix: https://github.com/project-jedi/jvcl/pull/4 [^]
|Fixed in branch master.|
|2012-10-01 20:54||jkelley||New Issue|
|2012-10-01 20:54||jkelley||File Added: jvprvwdocscrolling.diff|
|2013-01-15 15:42||obones||Note Added: 0020360|
|2013-01-15 15:42||obones||Status||new => feedback|
|2013-07-19 18:48||jkelley||File Added: PreviewDemo.zip|
|2013-07-19 19:19||jkelley||Note Added: 0020575|
|2013-12-02 17:48||AHUser||Note Added: 0020704|
|2013-12-02 17:48||AHUser||Status||feedback => resolved|
|2013-12-02 17:48||AHUser||Fixed in Version||=> Daily / SVN|
|2013-12-02 17:48||AHUser||Resolution||open => fixed|
|2013-12-02 17:48||AHUser||Assigned To||=> AHUser|
|2015-09-14 13:20||obones||Fixed in Version||Daily / GIT => 3.48|
|Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group|