Marker line, remove border

124 views
Skip to first unread message

Teodor Petrov

unread,
Nov 29, 2011, 5:21:07 PM11/29/11
to scintilla...@googlegroups.com
Hello,

I'm writing a svn blame application and I'm using wxWidgets (wxGTK 2.9.2 to be exact).

I'm using markers to set the background of the lines in a specific color depending on
the revision of the line. The problem is that I don't get a continuous block, but every
line has some kind of a border and it is very ugly and it is not what I want to achieve.
I want to get a continuous block of lines, if all the lines have been modified in a single
revision. Is this possible with Scintilla?

This is the relevant part of the code I'm using.

    wxStyledTextCtrl *ctrl;
    ctrl->MarkerDefine(5, wxSTC_MARK_CIRCLE, *wxRED, *wxGREEN);
    ctrl->MarkerSetBackground(index, wxColour(255, 0, 0));
    ctrl->MarkerSetAlpha(index, 64);
    ....
    ctrl->SetMarginMask(MARGIN_AUTHOR_REVISION, 0);
    ctrl->SetMarginMask(MARGIN_LINE_NUMBERS, 0);
    ....
    for (int ii=5; ii<15; ++ii)
        ctrl->MarkerAdd(line, 5);

Here is a screen shot of my app:
http://i776.photobucket.com/albums/yy46/fuscated/pics_in_forums/scintilla_markers.png

Best regards,
Teodor Petrov


screen shot

Neil Hodgson

unread,
Nov 29, 2011, 6:24:12 PM11/29/11
to scintilla...@googlegroups.com
Teodor Petrov:

> I'm using markers to set the background of the lines in a specific color depending on
> the revision of the line. The problem is that I don't get a continuous block, but every
> line has some kind of a border and it is very ugly and it is not what I want to achieve.

This appears to be a bug in the wxStyledTextCtrl platform code,
probably in the AlphaRectangle method. Running the following script in
SciTE produces a solid background shown in
http://scintilla.org/MarkerBackground.png

editor:MarkerDefine(5, SC_MARK_CIRCLE, 0)
editor:MarkerSetBack(5, 0x0000ff)
editor:MarkerSetAlpha(5, 64)
editor.MarginMaskN[1] = 0
for line = 5, 15 do
editor:MarkerAdd(line, 5)
end

Neil

Teodor Petrov

unread,
Nov 29, 2011, 8:04:40 PM11/29/11
to scintilla...@googlegroups.com
On 30.11.2011 01:24, Neil Hodgson wrote:
>
> This appears to be a bug in the wxStyledTextCtrl platform code,
> probably in the AlphaRectangle method. Running the following script in
> SciTE produces a solid background shown in
> http://scintilla.org/MarkerBackground.png
>
> editor:MarkerDefine(5, SC_MARK_CIRCLE, 0)
> editor:MarkerSetBack(5, 0x0000ff)
> editor:MarkerSetAlpha(5, 64)
> editor.MarginMaskN[1] = 0
> for line = 5, 15 do
> editor:MarkerAdd(line, 5)
> end
>
> Neil
>
I've tracked it and by changing this line, the problem is gone:

> Index: src/stc/PlatWX.cpp
> ===================================================================
> --- src/stc/PlatWX.cpp (revision 69813)
> +++ src/stc/PlatWX.cpp (working copy)
> @@ -380,7 +380,7 @@
> wxGCDC dc(*(wxMemoryDC*)hdc);
> wxColour penColour(wxColourFromCAandAlpha(outline, alphaOutline));
> wxColour brushColour(wxColourFromCAandAlpha(fill, alphaFill));
> - dc.SetPen(wxPen(penColour));
> + dc.SetPen(*wxTRANSPARENT_PEN);
> dc.SetBrush(wxBrush(brushColour));
> dc.DrawRoundedRectangle(wxRectFromPRectangle(rc), cornerSize);
> return;

Do I have to report this problem to the wx devs or this is something
that should be fixed in Scintilla?

Best regards,
Teodor

Neil Hodgson

unread,
Nov 30, 2011, 5:08:18 PM11/30/11
to scintilla...@googlegroups.com
Teodor Petrov:

> Do I have to report this problem to the wx devs or this is something that
> should be fixed in Scintilla?

This is in wx and should be reported to its maintainers.

Neil

Reply all
Reply to author
Forward
0 new messages