Files
nj/app/lib/features/editor/widgets/dot_grid_painter.dart
iven 49d4aa36a7
Some checks failed
Main Merge / backend (push) Has been cancelled
Main Merge / frontend (push) Has been cancelled
fix(app): Phase 1.1 紧急修复 — SyncEngine 接入 + authorId + catch 异常处理
- feat(sync): SyncEngine 接入 EditorPage, 保存时 enqueue + 网络恢复自动 trySync
- fix(editor): authorId 从 AuthBloc 获取, 替代硬编码 'local'
- fix(bloc): class_bloc/calendar/profile/parent catch(_).全部改为 debugPrint
- feat(editor): 编辑器工具栏拆分 (brush_panel/tag_panel/text_format_bar/dot_grid_painter)
- feat(editor): EditorBloc 扩展 + EditorPage 增强
- feat(search): SearchBloc 扩展搜索功能
- feat(home): HomeBloc/HomePage 增强
- feat(auth): LoginPage 增强
- feat(templates): TemplateGalleryPage 重构
- fix(web): 管理端班级/日记页面修复
- fix(server): comment_service + theme_handler 修复
- docs: 添加全链路审计报告和验证截图
2026-06-02 21:21:43 +08:00

29 lines
785 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 点阵背景画笔 — 24x24px 间距1px 圆点
// 用于日记编辑区域提供纸质感背景
import 'package:flutter/material.dart';
/// 点阵背景画笔 -- 24x24px 间距1px 圆点
class DotGridPainter extends CustomPainter {
const DotGridPainter();
@override
void paint(Canvas canvas, Size size) {
final paint = Paint()
..color = const Color(0xFF2D2420).withOpacity(0.15)
..style = PaintingStyle.fill;
const spacing = 24.0;
const dotRadius = 1.0;
for (double x = spacing; x < size.width; x += spacing) {
for (double y = spacing; y < size.height; y += spacing) {
canvas.drawCircle(Offset(x, y), dotRadius, paint);
}
}
}
@override
bool shouldRepaint(covariant DotGridPainter oldDelegate) => false;
}