Neil Hodgson | 26 Jun 2012 03:23

Allowing start of text to overlap margin

   Bugs #699587 and #3537799 demonstrate a problem with text at the start of line that is cut off. Examples are the "p" in print in the first window and the serifs on the first characters of both lines in the second window shown in http://www.scintilla.org/StartClip.png .

   These effects are most visible with aliased (unsmoothed) text with the bold or italics style attributes.

   These issues have been fixed by http://scintilla.hg.sourceforge.net/hgweb/scintilla/scintilla/rev/ad615dba313c which allows the start of text on a line to overlap 1 pixel into the margin. The changed behaviour can be seen in the third window of the image, This change is only active when the text is scrolled completely to the left.

   This is a change in the core drawing code so please report any regressions.

   Bugs:
https://sourceforge.net/tracker/index.php?func=detail&aid=699587&group_id=2439&atid=102439
https://sourceforge.net/tracker/index.php?func=detail&aid=3537799&group_id=2439&atid=102439

   Neil

--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.
mr.maX | 26 Jun 2012 11:09
Picon

Re: Allowing start of text to overlap margin

On Tuesday, June 26, 2012 3:23:39 AM UTC+2, Neil Hodgson wrote:

   These issues have been fixed by http://scintilla.hg.sourceforge.net/hgweb/scintilla/scintilla/rev/ad615dba313c which allows the start of text on a line to overlap 1 pixel into the margin.
 
const int leftTextOverlap = ((xOffset == 0) && (vs.rightMarginWidth > 0)) ? 1 : 0;

Shouldn't this be checking vs.leftMarginWidth instead, since you're drawing on top of the left margin?

-- 
Regards,
Marko Njezic - mr.maX <at> MAX Interactive corp.
Personal: http://www.markonjezic.com/
MAX's Empire: http://www.maxempire.com/
MAX's HTML Beauty++ 2004: http://www.htmlbeauty.com/

--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To view this discussion on the web visit https://groups.google.com/d/msg/scintilla-interest/-/5WXS5y-5h7oJ.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.
Neil Hodgson | 27 Jun 2012 03:02

Re: Allowing start of text to overlap margin

mr.maX:

> const int leftTextOverlap = ((xOffset == 0) && (vs.rightMarginWidth > 0)) ? 1 : 0;
> 
> Shouldn't this be checking vs.leftMarginWidth instead, since you're drawing on top of the left margin?

   Yes, fixed.

   Neil

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

mr.maX | 27 Jun 2012 14:03
Picon

Re: Allowing start of text to overlap margin

On Tuesday, June 26, 2012 3:23:39 AM UTC+2, Neil Hodgson wrote:

   This is a change in the core drawing code so please report any regressions.

Further testing has revealed several issues:

- You completely forgot to update code that triggers screen redrawing, which leads to artifacts inside text margin when deleting characters that overlap it for example.
- There is one more conditional check that needs to be updated in Paint() method in order to prevent flickering inside text margin.

These two issues are fixed by this patch: http://pastebin.com/8QW9U0Di

- Block caret can sometimes be drawn wrongly inside margin due to this change. This is fixed by this patch: http://pastebin.com/iwCmwGEc

Besides this, testing block caret drawing has uncovered another issue when using Direct2D. Due to missing clipped text drawing, block caret (and text blobs) can be drawn incorrectly in certain cases. Clipped text drawing under Direct2D is implemented by this patch: http://pastebin.com/ckbBXNDh

-- 
Regards,
Marko Njezic - mr.maX <at> MAX Interactive corp.
Personal: http://www.markonjezic.com/
MAX's Empire: http://www.maxempire.com/
MAX's HTML Beauty++ 2004: http://www.htmlbeauty.com/

--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To view this discussion on the web visit https://groups.google.com/d/msg/scintilla-interest/-/VLQqcb-3iR0J.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.
Neil Hodgson | 29 Jun 2012 13:29

Re: Allowing start of text to overlap margin

mr.maX:

> Besides this, testing block caret drawing has uncovered another issue when using Direct2D. Due to
missing clipped text drawing, block caret (and text blobs) can be drawn incorrectly in certain cases.
Clipped text drawing under Direct2D is implemented by this patch: http://pastebin.com/ckbBXNDh

   This patch also contains an unexplained change to text layout height.

   Neil

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

mr.maX | 29 Jun 2012 23:37
Picon

Re: Allowing start of text to overlap margin

On Friday, June 29, 2012 1:29:42 PM UTC+2, Neil Hodgson wrote:

mr.maX:

> Besides this, testing block caret drawing has uncovered another issue when using Direct2D. Due to missing clipped text drawing, block caret (and text blobs) can be drawn incorrectly in certain cases. Clipped text drawing under Direct2D is implemented by this patch: http://pastebin.com/ckbBXNDh

   This patch also contains an unexplained change to text layout height.

All changes from that patch are related to clipping since I know how sensitive you are when it comes to my patches. Using rc.Height() does not return the correct height (probably due to difference between DIPs and pixels, but I couldn't be bothered to check the actual reason why). You were actually aware of this issue (either purposely or by pure accident), since in the fallback code that you recently removed you weren't using rc.top value when calculating layout rectangle and you used calculation like in my patch instead. The fact that height is wrong can also be verified by using D2D1_DRAW_TEXT_OPTIONS_CLIP option when drawing layout. However, using a separate clipping rectangle like I did will implement clipping more like in GDI.

-- 
Regards,
Marko Njezic - mr.maX <at> MAX Interactive corp.
Personal: http://www.markonjezic.com/
MAX's Empire: http://www.maxempire.com/
MAX's HTML Beauty++ 2004: http://www.htmlbeauty.com/

--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To view this discussion on the web visit https://groups.google.com/d/msg/scintilla-interest/-/kDadnmTwyj8J.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.
Neil Hodgson | 30 Jun 2012 01:40

Re: Allowing start of text to overlap margin

mr.maX:

> All changes from that patch are related to clipping since I know how sensitive you are when it comes to my
patches. Using rc.Height() does not return the correct height (probably due to difference between DIPs
and pixels, but I couldn't be bothered to check the actual reason why). You were actually aware of this
issue (either purposely or by pure accident), since in the fallback code that you recently removed you
weren't using rc.top value when calculating layout rectangle and you used calculation like in my patch
instead. The fact that height is wrong can also be verified by using D2D1_DRAW_TEXT_OPTIONS_CLIP option
when drawing layout. However, using a separate clipping rectangle like I did will implement clipping
more like in GDI.

   There don't appear to be any differences in the display with the change in height calculation. Is there a
particular font that demonstrates this issue?

   Neil

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

Neil Hodgson | 2 Jul 2012 14:27

Re: Allowing start of text to overlap margin

mr.maX:

> - You completely forgot to update code that triggers screen redrawing, which leads to artifacts inside
text margin when deleting characters that overlap it for example.
> - There is one more conditional check that needs to be updated in Paint() method in order to prevent
flickering inside text margin.
> 
> These two issues are fixed by this patch: http://pastebin.com/8QW9U0Di

   Committed.

> - Block caret can sometimes be drawn wrongly inside margin due to this change. This is fixed by this patch: http://pastebin.com/iwCmwGEc

   Can't reproduce. Found a problem with zero-width characters at start of line expanding block caret range
back into previous line and fixed that.

> Besides this, testing block caret drawing has uncovered another issue when using Direct2D. Due to
missing clipped text drawing, block caret (and text blobs) can be drawn incorrectly in certain cases.
Clipped text drawing under Direct2D is implemented by this patch: http://pastebin.com/ckbBXNDh

   Committed the clipping but not the change in height calculation.

   Neil

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

mr.maX | 2 Jul 2012 20:02
Picon

Re: Allowing start of text to overlap margin

On Monday, July 2, 2012 2:27:11 PM UTC+2, Neil Hodgson wrote:

mr.maX:

> - Block caret can sometimes be drawn wrongly inside margin due to this change. This is fixed by this patch: http://pastebin.com/iwCmwGEc

   Can't reproduce. Found a problem with zero-width characters at start of line expanding block caret range back into previous line and fixed that.

This screenshot illustrates the problem: http://postimage.org/image/6n1gip863/ One pixel vertical line is part of block caret that is drawn inside left margin.

> Besides this, testing block caret drawing has uncovered another issue when using Direct2D. Due to missing clipped text drawing, block caret (and text blobs) can be drawn incorrectly in certain cases. Clipped text drawing under Direct2D is implemented by this patch: http://pastebin.com/ckbBXNDh

   Committed the clipping but not the change in height calculation.

This screenshot illustrates that the height you're using is wrong: http://postimage.org/image/clglrctet/ I don't understand why you want to keep the wrong code, you could have set the height to zero in that case as the current value is useless as is.

--
Regards,
Marko Njezic - mr.maX <at> MAX Interactive corp.
Personal: http://www.markonjezic.com/
MAX's Empire: http://www.maxempire.com/
MAX's HTML Beauty++ 2004: http://www.htmlbeauty.com/

--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To view this discussion on the web visit https://groups.google.com/d/msg/scintilla-interest/-/8SarNKqYMYsJ.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.
Neil Hodgson | 3 Jul 2012 15:20

Re: Allowing start of text to overlap margin

mr.maX wrote:

> This screenshot illustrates that the height you're using is wrong:
http://postimage.org/image/clglrctet/ I don't understand why you want to keep the wrong code, you
could have set the height to zero in that case as the current value is useless as is.

   Yes, the height can be set to zero with no ill effects. It appears that the height value is not used when the
options argument is D2D1_DRAW_TEXT_OPTIONS_NONE.

   Neil

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.


Gmane