Bug 205728 - Dashed border text style has various problems
Summary: Dashed border text style has various problems
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 185966 47136
  Show dependency tree
 
Reported: 2007-10-08 09:47 EDT by Dani Megert CLA
Modified: 2019-09-06 16:17 EDT (History)
4 users (show)

See Also:


Attachments
Screenshots (2.47 KB, image/png)
2007-10-25 03:03 EDT, Markus Keller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2007-10-08 09:47:26 EDT
N20071005-0010.

The dashed border text style has various problems:
1. the dashes are not good visible (space and dash too small)
2. for some font sizes the dashes are not stable while typing and hence
   looks noisy (test case: use courier new regular 18)
3. the dashed border style is not closed on the top left corner but open
Comment 1 Dani Megert CLA 2007-10-08 09:48:50 EDT
As a reference please use org.eclipse.ui.texteditor.SourceViewerDecorationSupport.DashedBoxDrawingStrategy.drawBox(GC, StyledText, Color, Rectangle)
Comment 2 Dani Megert CLA 2007-10-09 07:17:17 EDT
Please also see bug 185966 comment 2 which talks about problems with Platform Texts (no longer used) dashed line drawing code.
Comment 3 Felipe Heidrich CLA 2007-10-18 16:36:02 EDT
Okay, basically I need to change the line style from DASH (3 on 1 off) to 3 on 3 off. And, replace the one call to drawRectangle to 4 calls to drawLine.

That is okay, the only thing it that SWT.LINE_DASH and SWT.BORDER_DASH won't have the same pattern.
Comment 4 Markus Keller CLA 2007-10-19 06:23:32 EDT
> And, replace the one call to drawRectangle to 4 calls to drawLine.

To make sure that the horizontal lines keep their appearance (don't look animated) when the range is expanded/shrinked at the right side, the horizontal lines always have to start from left.

And to fix bug 185966, you need to make sure that all lines end in the corners with 3 on. This could result in shorter (1 or 2 px) off, which look a bit strange.  After some experiments, I guess the best option would be to avoid these 1-2 off and make them on too in such situations, but this this is matter of taste.

Examples (- == on; . == off):
Good:                              Not so good (but still OK):
---...---...---
---...---...----
---...---...-----
---...---...------
---...---...-------                ---...---...---.---
---...---...--------               ---...---...---..---
---...---...---...---
Comment 5 Dani Megert CLA 2007-10-22 09:34:08 EDT
>That is okay, the only thing it that SWT.LINE_DASH and SWT.BORDER_DASH won't
>have the same pattern.
I think that's OK.
Comment 6 Markus Keller CLA 2007-10-25 03:03:46 EDT
Created attachment 81135 [details]
Screenshots

Another problem with SWT.BORDER_DASH is that the 'off' segments are not drawn with the background color.

The main advantage of the dashed boxes in the text editor implementation was that the border was visible around selected as well as around unselected text.
Comment 7 Dani Megert CLA 2008-04-24 06:14:10 EDT
Any chance for 3.4?
Comment 8 Dani Megert CLA 2010-02-02 06:25:23 EST
Ping.
Comment 9 Felipe Heidrich CLA 2010-02-05 16:39:13 EST
sorry for the delayed answer Dani.
We are running against time to make sure we get all new API in before M6.

We can probably look at this problem after API freeze.

Is this problem really bad for Eclipse ? I think it is a small detail (3 by 1 versus 3 by 3) and the current behaviour is the correct platform look for dash (PS_DASH Pen).
Comment 10 Dani Megert CLA 2010-02-08 04:43:21 EST
>Is this problem really bad for Eclipse ?
Not bad but ugly enough for us that we don't use it (see bug 185966 ;-).

Could be a polish item.
Comment 11 Markus Keller CLA 2010-02-08 04:48:50 EST
> Is this problem really bad for Eclipse ? I think it is a small detail (3 by 1
> versus 3 by 3).

3 by 1 vs. 3 by 3 is indeed not the deal breaker (although it definitely looks better). What's really bad is comment 6 ("off" segments not drawn with background color).
Comment 12 Eclipse Webmaster CLA 2019-09-06 16:17:52 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.