diff options
| author | nyamatongwe <devnull@localhost> | 2013-02-18 14:32:16 +1100 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2013-02-18 14:32:16 +1100 | 
| commit | 8fe79e81ff75d1f7d28ae5497b9b6842e26a6161 (patch) | |
| tree | 9cc94c721dfca545beac19ba6e5bcb24f4f44597 | |
| parent | 02b2001a78189a0f4a6c3b51849efba161e0f7ab (diff) | |
| download | scintilla-mirror-8fe79e81ff75d1f7d28ae5497b9b6842e26a6161.tar.gz | |
Fix drawing of markers at negative coordinates due to integer truncation.
For elastic over-shoot scrolling, Scintilla may draw lines before 0 so
draws markers at negative coordinates. Normal float->int coercion uses
truncation so that markers will be drawn a pixel away from where they
should be for consistent placement within the marker space. If scrolling
causes drawing in slices, a line may be drawn twice.
| -rw-r--r-- | src/LineMarker.cxx | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index 9b7f1cddc..94513f5d0 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -6,6 +6,7 @@  // The License.txt file describes the conditions under which this software may be distributed.  #include <string.h> +#include <math.h>  #include <vector>  #include <map> @@ -112,8 +113,8 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac  	rc.bottom--;  	int minDim = Platform::Minimum(rc.Width(), rc.Height());  	minDim--;	// Ensure does not go beyond edge -	int centreX = (rc.right + rc.left) / 2; -	int centreY = (rc.bottom + rc.top) / 2; +	int centreX = floor((rc.right + rc.left) / 2.0); +	int centreY = floor((rc.bottom + rc.top) / 2.0);  	int dimOn2 = minDim / 2;  	int dimOn4 = minDim / 4;  	int blobSize = dimOn2-1;  | 
