Make cursors and select tools visible without special blend modes

This commit is contained in:
Yousef Khadadeh 2026-04-15 20:58:25 +03:00
parent bd4d662dd9
commit c85fb11636
8 changed files with 39 additions and 48 deletions

View file

@ -125,15 +125,20 @@ void EraserTool::draw(SkCanvas* canvas, const DrawData& drawData) {
float width = relativeWidthResult.first.value() * 0.5f;
SkPaint linePaint;
linePaint.setAntiAlias(drawData.skiaAA);
linePaint.setColor4f({1.0f, 1.0f, 1.0f, 0.5f});
linePaint.setColor4f({0.0f, 0.0f, 0.0f, 0.4f});
linePaint.setStyle(SkPaint::kStroke_Style);
linePaint.setStrokeCap(SkPaint::kRound_Cap);
linePaint.setStrokeWidth(width * 2.0f);
linePaint.setBlender(CanvasTheme::get_visible_blend_mode());
linePaint.setStrokeWidth(width * 2.0f + 1.0f);
SkPathBuilder erasePath;
erasePath.moveTo(convert_vec2<SkPoint>(lastPos));
erasePath.lineTo(convert_vec2<SkPoint>(drawData.main->input.mouse.pos));
canvas->drawPath(erasePath.detach(), linePaint);
SkPath erasePathDetach = erasePath.detach();
canvas->drawPath(erasePathDetach, linePaint);
linePaint.setStrokeWidth(width * 2.0f);
linePaint.setColor4f({1.0f, 1.0f, 1.0f, 0.4f});
canvas->drawPath(erasePathDetach, linePaint);
}
lastPos = drawData.main->input.mouse.pos;