Menu

#2133 SCI_MARKERSETALPHA doesn't work for markers with type SC_MARK_BACKGROUND

Bug
closed-works-for-me
nobody
5
2023-11-30
2019-10-18
No

When I try to call SCI_MARKERSETALPHA on a marker with type explicitly set to SC_MARK_BACKGROUND the marker no longer draws at all. The same does work for markers of any other type that implicitly draw the line background because the symbol margin is hidden.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2019-10-18

    Here is a picture of SC_MARK_BACKGROUND with an alpha of 0x40.
    SC_MARK_BACKGROUND

    It may depend on your platform or (edited: implicits do work, so platform is doing alpha) other settings.

     

    Last edit: Neil Hodgson 2019-10-18
  • Jason Haslam

    Jason Haslam - 2019-10-18

    I'm sorry. It also seems to depend on the margin settings. When I revert to the default margin settings with a symbol margin visible it works again. I suspect that it's the same condition that makes the other markers automatically switch to background markers.

     
  • Neil Hodgson

    Neil Hodgson - 2019-10-18

    Its a complex case as it isn't drawn with the rest of the markers in LineMarker::Draw and depends on ViewStyle::Background instead. Possibly an issue with the masks calculated in ViewStyle::CalculateMarginWidthAndMask?

    This is the code I use to experiment with markers in SciTE

    function ShowAllIndicators()
        local lineStart = 371 -- Set this to number of line before SC_MARK_CIRCLE
        local markers = {
    
         SC_MARK_CIRCLE,
         SC_MARK_ROUNDRECT,
         SC_MARK_SMALLRECT,
         SC_MARK_SHORTARROW,
         SC_MARK_BOOKMARK,
         SC_MARK_VERTICALBOOKMARK,
         SC_MARK_FULLRECT,
         SC_MARK_LEFTRECT,
         SC_MARK_BACKGROUND,
         SC_MARK_UNDERLINE,
         SC_MARK_DOTDOTDOT,
         SC_MARK_ARROWS,
         SC_MARK_ARROW,
         SC_MARK_ARROWDOWN,
         SC_MARK_PLUS,
         SC_MARK_MINUS,
         SC_MARK_BOXPLUS,
         SC_MARK_BOXPLUSCONNECTED,
         SC_MARK_BOXMINUS,
         SC_MARK_BOXMINUSCONNECTED,
         SC_MARK_CIRCLEPLUS,
         SC_MARK_CIRCLEPLUSCONNECTED,
         SC_MARK_CIRCLEMINUS,
         SC_MARK_CIRCLEMINUSCONNECTED,
         SC_MARK_VLINE,
         SC_MARK_LCORNER,
         SC_MARK_TCORNER,
         SC_MARK_LCORNERCURVE,
         SC_MARK_TCORNERCURVE
    
        }
        editor.MarginMaskN[1] = 0x7fffffff
        local line = 0
        for i, v in ipairs(markers) do
            local m = v
            editor:MarkerDeleteAll(line)
            editor:MarkerDefine(line, m)
            editor.MarkerAlpha[line] = 0x30
            if m == SC_MARK_BOOKMARK or m == SC_MARK_VERTICALBOOKMARK or m == SC_MARK_LEFTRECT then
                    editor.MarkerFore[line] = 0x0000BE
                    editor.MarkerBack[line] = 0x4040E2
            elseif line < 16 then
                    editor.MarkerFore[line] = 0x000000
                    editor.MarkerBack[line] = 0x90D0A0
            else
                    editor.MarkerFore[line] = 0xFFC0A0
                    editor.MarkerBack[line] = 0x000000
            end
            editor:MarkerAdd(line+lineStart, line)
            line = line + 1
        end
    end
    

    That looks like this without a symbol margin:
    Without margin

     
  • Jason Haslam

    Jason Haslam - 2019-10-19

    Hmm... I'm not sure what's going on. I may try to dig a little deeper. It's not a high priority since I can work around it.

     
  • Neil Hodgson

    Neil Hodgson - 2020-01-08
    • labels: --> scintilla, qt, marker
    • status: open --> open-works-for-me
     
  • Neil Hodgson

    Neil Hodgson - 2023-11-30
    • status: open-works-for-me --> closed-works-for-me
     
  • Neil Hodgson

    Neil Hodgson - 2023-11-30

    Closing as it does work for me and there have been no more details to enable reproducing problem.

     

Log in to post a comment.

Auth0 Logo