<commit_before>#include "accent/selectionaccentpainter.h"

#include <QPainter>
#include <QPen>
#include <QDebug>

SelectionAccentPainter::SelectionAccentPainter(const QColor& rectColor, const QColor& shadeColor)
    : _cinemaScopePainter(shadeColor, 100)
    , _rectangleSelectedPainter(QPen(rectColor, 1, Qt::SolidLine))
    , _rectangleHighlightedPainter(QPen(rectColor, 1, Qt::DashLine))
{
}

void SelectionAccentPainter::paint(QPainter *painter, const RegionContext* context) {
    Q_ASSERT(painter != NULL);
    Q_ASSERT(context != NULL);

    const QRect& selectedRegion = context->selectedRegion();
    paint(painter, context->scopeRegion(), selectedRegion);

    const QRect& highlightedRegion = context->highlightedRegion();
    if (selectedRegion.contains(highlightedRegion, false) || selectedRegion.intersects(highlightedRegion) ) {
        QRect intersectedRegion = (selectedRegion.intersects(highlightedRegion))
                ? selectedRegion.intersected(highlightedRegion)
                : highlightedRegion;

        QRect innerRegion = intersectedRegion.adjusted(0,0,-1,-1);
        _rectangleHighlightedPainter.paint(painter, selectedRegion, innerRegion);
    }
}

void SelectionAccentPainter::paint(QPainter *painter, const QRect& scope, const QRect& region) {
    Q_ASSERT(painter != NULL);

    QRect outerRegion = region.adjusted(0,0,-1,-1);<commit_msg>bug fixing (reset full shader after crop)<commit_after>#include "accent/selectionaccentpainter.h"

#include <QPainter>
#include <QPen>
#include <QDebug>

SelectionAccentPainter::SelectionAccentPainter(const QColor& rectColor, const QColor& shadeColor)
    : _cinemaScopePainter(shadeColor, 100)
    , _rectangleSelectedPainter(QPen(rectColor, 1, Qt::SolidLine))
    , _rectangleHighlightedPainter(QPen(rectColor, 1, Qt::DashLine))
{
}

void SelectionAccentPainter::paint(QPainter *painter, const RegionContext* context) {
    Q_ASSERT(painter != NULL);
    Q_ASSERT(context != NULL);

    const QRect& selectedRegion = context->selectedRegion();
    if (!context->fullWidgetMode()) {
        if (!RegionContext::isValidRegion(selectedRegion)){
            return;
        }
    }

    paint(painter, context->scopeRegion(), selectedRegion);

    const QRect& highlightedRegion = context->highlightedRegion();
    if (selectedRegion.contains(highlightedRegion, false) || selectedRegion.intersects(highlightedRegion) ) {
        QRect intersectedRegion = (selectedRegion.intersects(highlightedRegion))
                ? selectedRegion.intersected(highlightedRegion)
                : highlightedRegion;

        QRect innerRegion = intersectedRegion.adjusted(0,0,-1,-1);
        _rectangleHighlightedPainter.paint(painter, selectedRegion, innerRegion);
    }
}

void SelectionAccentPainter::paint(QPainter *painter, const QRect& scope, const QRect& region) {
    Q_ASSERT(painter != NULL);

    QRect outerRegion = region.adjusted(0,0,-1,-1);
{'fraction_non_alphanumeric': 0.11415838189921151, 'fraction_numerical': 0.008913267055193692, 'mean_word_length': 4.894949494949495, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2342501', 'n_tokens_mistral': 949, 'n_tokens_neox': 866, 'n_words': 154}