测试绘制网格

This commit is contained in:
LiXiaoqi 2024-09-07 17:54:29 +08:00
parent 01d32c6d5d
commit 3497e3fd1c
2 changed files with 17 additions and 11 deletions

View File

@ -88,6 +88,8 @@ class _PasstrackState extends State<PassTrackWidget> {
var f = initPlatformState(); var f = initPlatformState();
f.then((void _) { f.then((void _) {
_passTrackPlugin.setGridColor(const Color.fromARGB(255, 0, 0, 0).value);
_passTrackPlugin.drawGrid();
var future = controller.getHisFileList(_passTrackPlugin); var future = controller.getHisFileList(_passTrackPlugin);
future.then((value) { future.then((value) {
_passTrackPlugin.setScale(1); _passTrackPlugin.setScale(1);
@ -97,9 +99,15 @@ class _PasstrackState extends State<PassTrackWidget> {
for (var item in controller.coorTransMap.entries) { for (var item in controller.coorTransMap.entries) {
print("tid:${item.key} value:${item.value}"); print("tid:${item.key} value:${item.value}");
} }
_passTrackPlugin.generateTile(0, value); //
var start = DateTime.now().millisecondsSinceEpoch;
// _passTrackPlugin.generateTile(0, value);
_passTrackPlugin.waitForTile(); _passTrackPlugin.waitForTile();
// _passTrackPlugin.drawGrid();
_passTrackPlugin.playTrack(0, value, true, 0, ffi.nullptr); _passTrackPlugin.playTrack(0, value, true, 0, ffi.nullptr);
//
var end = DateTime.now().millisecondsSinceEpoch;
print("耗时:${end - start}");
}); });
}); });
} }
@ -134,13 +142,13 @@ class _PasstrackState extends State<PassTrackWidget> {
ScenceMapView( ScenceMapView(
children: [ children: [
Positioned( Positioned(
top: 0, top: 0,
left: 0, left: 0,
child: SizedBox( child: SizedBox(
width: sWidth * 1.0, width: sWidth * 1.0,
height: sWidth * 1.0, height: sWidth * 1.0,
// child: Text('Running on: $_platformVersion\n'), // child: Text('Running on: $_platformVersion\n'),
child: Texture(textureId: fileHandle.textureId))), child: Texture(textureId: fileHandle.textureId))),
], ],
onUpdate: (Offset center, double scale, double rotation) { onUpdate: (Offset center, double scale, double rotation) {
print("center:$center scale:$scale rotation:$rotation"); print("center:$center scale:$scale rotation:$rotation");
@ -255,7 +263,6 @@ class _PasstrackState extends State<PassTrackWidget> {
), ),
const SizedBox(width: 12), const SizedBox(width: 12),
Column( Column(
children: [ children: [
const Text("此处遍数0"), const Text("此处遍数0"),
StreamBuilder<DateTime>( StreamBuilder<DateTime>(
@ -286,7 +293,6 @@ class _PasstrackState extends State<PassTrackWidget> {
), ),
], ],
), ),
], ],
), ),
), ),

@ -1 +1 @@
Subproject commit 26455a018ed9cdda8413c8477baeaa38bd57499f Subproject commit bc4de9cc6145dd03116e9b0557902d87776e9671