The previous logic added a pen stroke at the top 3 pixels wide, and 5 pixels at the bottom. Probably because the lower pen stroke is misaligned (too far down) and needs a larger stroke width to compensate for this misalignment, which causes part of that stroke (the lower part) to be cut of by the next line (but not if the selection is on the last line).
This causes different effects both at lines selected in the middle of the log as well as the end of the log (last line) in different ways.
It also re-added pen several times after changing the width of the pen, which is simply unnecessary (and may have added to this effect of increasing color intensity in the original version)
The fix simple removes unnecessary lines of code as well as adjusting the position of the lower stroke and removing the previous attempt to compensate for it with stroke width.
The previous logic added a pen stroke at the top 3 pixels wide, and 5 pixels at the bottom. Probably because the lower pen stroke is misaligned (too far down) and needs a larger stroke width to compensate for this misalignment, which causes part of that stroke (the lower part) to be cut of by the next line (but not if the selection is on the last line).
This causes different effects both at lines selected in the middle of the log as well as the end of the log (last line) in different ways.
It also re-added pen several times after changing the width of the pen, which is simply unnecessary (and may have added to this effect of increasing color intensity in the original version)
The fix simple removes unnecessary lines of code as well as adjusting the position of the lower stroke and removing the previous attempt to compensate for it with stroke width.
Last line (before fix):
Line in the middle of document (before fix):
Last line (after fix):
Line in the middle of document (after fix):