| 12345678910111213141516171819202122232425262728293031323334 |
- import '../widget_ruler.dart';
- import 'game_std_controller.dart';
- class LayerMapRuler extends LayerView<GameStdController> {
- const LayerMapRuler({super.key});
- @override
- Widget build(BuildContext context) {
- return Obx(() {
- if (viewModel.isShowRuler.value) {
- final mapScale = viewModel.mapScale;
- if (mapScale == 0) {
- return const SizedBox();
- }
- var height = context.height / 2;
- var hideHeight = 0.0;
- if (viewModel.isMapRotateAtCompassCenter.value) {
- height = viewModel.compassCenter.dy;
- hideHeight = viewModel.compassDiameter / 2 + 1;
- }
- return Container(
- alignment: Alignment.topCenter,
- padding: EdgeInsets.only(top: context.mediaQueryPadding.top),
- height: height,
- child: Ruler(hideHeight: hideHeight, mapScale: mapScale));
- } else {
- return const SizedBox();
- }
- });
- }
- }
|