mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 12:48:41 +00:00
fix #267
This commit is contained in:
parent
dbce69ac2b
commit
5b486f6b68
3 changed files with 42 additions and 3 deletions
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
## 0.0.61
|
## 0.0.61
|
||||||
|
|
||||||
|
- Improving image editor when changing colors
|
||||||
- Fixing message decryption error
|
- Fixing message decryption error
|
||||||
- Fixing issue with user deletion
|
- Fixing issue with user deletion
|
||||||
- Fixing issue with flame counter sync
|
- Fixing issue with flame counter sync
|
||||||
- Dependency and Flutter upgrade
|
- Dependency and Flutter upgrade
|
||||||
- Developer Settings
|
|
||||||
|
|
||||||
## 0.0.60
|
## 0.0.60
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,5 +77,12 @@ class DrawLayerData extends Layer {
|
||||||
super.hasCustomActionButtons = true,
|
super.hasCustomActionButtons = true,
|
||||||
super.isEditing = true,
|
super.isEditing = true,
|
||||||
});
|
});
|
||||||
final control = HandSignatureControl();
|
final control = HandSignatureControl(
|
||||||
|
// ignore: prefer_const_constructors
|
||||||
|
setup: () => SignaturePathSetup(
|
||||||
|
args: {
|
||||||
|
'color': null,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:hand_signature/signature.dart';
|
import 'package:hand_signature/signature.dart';
|
||||||
|
// ignore: implementation_imports
|
||||||
|
import 'package:hand_signature/src/utils.dart';
|
||||||
import 'package:screenshot/screenshot.dart';
|
import 'package:screenshot/screenshot.dart';
|
||||||
import 'package:twonly/src/utils/misc.dart';
|
import 'package:twonly/src/utils/misc.dart';
|
||||||
import 'package:twonly/src/views/camera/image_editor/action_button.dart';
|
import 'package:twonly/src/views/camera/image_editor/action_button.dart';
|
||||||
|
|
@ -91,7 +93,7 @@ class _DrawLayerState extends State<DrawLayer> {
|
||||||
controller: screenshotController,
|
controller: screenshotController,
|
||||||
child: HandSignature(
|
child: HandSignature(
|
||||||
control: widget.layerData.control,
|
control: widget.layerData.control,
|
||||||
drawer: LineSignatureDrawer(color: currentColor, width: 7),
|
drawer: CustomSignatureDrawer(color: currentColor, width: 7),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -242,3 +244,33 @@ class MagnifyingGlass extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CustomSignatureDrawer extends HandSignatureDrawer {
|
||||||
|
const CustomSignatureDrawer({
|
||||||
|
this.width = 1.0,
|
||||||
|
this.color = Colors.black,
|
||||||
|
});
|
||||||
|
final Color color;
|
||||||
|
final double width;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void paint(Canvas canvas, Size size, List<CubicPath> paths) {
|
||||||
|
for (final path in paths) {
|
||||||
|
var lineColor = color;
|
||||||
|
if (path.setup.args!['color'] != null) {
|
||||||
|
lineColor = path.setup.args!['color'] as Color;
|
||||||
|
} else {
|
||||||
|
path.setup.args!['color'] = color;
|
||||||
|
}
|
||||||
|
final paint = Paint()
|
||||||
|
..color = lineColor
|
||||||
|
..style = PaintingStyle.stroke
|
||||||
|
..strokeCap = StrokeCap.round
|
||||||
|
..strokeJoin = StrokeJoin.round
|
||||||
|
..strokeWidth = width;
|
||||||
|
if (path.isFilled) {
|
||||||
|
canvas.drawPath(PathUtil.toLinePath(path.lines), paint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue