diff --git a/lib/pages/pile/pileGenerateCard/pileGenerate.dart b/lib/pages/pile/pileGenerateCard/pileGenerate.dart index 061c365..5120aa8 100644 --- a/lib/pages/pile/pileGenerateCard/pileGenerate.dart +++ b/lib/pages/pile/pileGenerateCard/pileGenerate.dart @@ -218,14 +218,11 @@ class _PileGenerateState extends State { (item.dy - dy) * sin(rotation)); var dy1 = -(item.dx - dx) * sin(rotation) + (item.dy - dy) * cos(rotation); - dx1 = double.parse( - (dx1 * 1000 / 1000).toStringAsFixed(3)); - dy1 = double.parse( - (dy1 * 1000 / 1000).toStringAsFixed(3)); + Offset xy = mapController.ScreenCenter2xy(dx1, dy1); PilePoint pilePoint = PilePoint( - x: xy.dx, - y: xy.dy, + x: (xy.dx * 1000).roundToDouble() / 1000, + y: (xy.dy * 1000).roundToDouble() / 1000, times: 0, id: i + 1, radius: 0.3); diff --git a/lib/pages/pile/pileGenerateCard/pilePointTable.dart b/lib/pages/pile/pileGenerateCard/pilePointTable.dart index 0dbe32c..2f2e5e7 100644 --- a/lib/pages/pile/pileGenerateCard/pilePointTable.dart +++ b/lib/pages/pile/pileGenerateCard/pilePointTable.dart @@ -70,7 +70,8 @@ class _PilePointTableState extends State { TableCell( verticalAlignment: TableCellVerticalAlignment.middle, child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.0), + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 0), child: Checkbox( value: _selected[index], onChanged: (bool? value) { @@ -84,29 +85,30 @@ class _PilePointTableState extends State { TableCell( verticalAlignment: TableCellVerticalAlignment.middle, child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.0), + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 0), child: Text(widget.pilePoints[index].id.toString()), ), ), TableCell( verticalAlignment: TableCellVerticalAlignment.middle, child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.0), + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 0), child: GestureDetector( onTap: () => _editPilePoint(context, index, 'x'), - child: - Text(widget.pilePoints[index].x.toString()), + child: Text(widget.pilePoints[index].x.toString()), ), ), ), TableCell( verticalAlignment: TableCellVerticalAlignment.middle, child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.0), + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 0), child: GestureDetector( onTap: () => _editPilePoint(context, index, 'y'), - child: - Text(widget.pilePoints[index].y.toString()), + child: Text(widget.pilePoints[index].y.toString()), ), ), ),