@@ -129,7 +129,7 @@ function BlueprintDialog:init()
129129 },
130130 widgets .HotkeyLabel {
131131 frame = {b = 0 , l = 15 },
132- key = ' SELECT_ALL ' , -- TODO: change to SEC_SELECT once 51.01 is stable
132+ key = ' SEC_SELECT ' ,
133133 label = ' Delete selected blueprint' ,
134134 on_activate = self :callback (' delete_blueprint' ),
135135 enabled = function ()
@@ -545,35 +545,8 @@ function Quickfort:on_transform_change(val)
545545 self .dirty = true
546546end
547547
548- local origin , test_point = {x = 0 , y = 0 }, {x = 1 , y =- 2 }
549- local minimal_sequence = {
550- [' x=1, y=-2' ] = {},
551- [' x=2, y=-1' ] = {' cw' , ' flipv' },
552- [' x=2, y=1' ] = {' cw' },
553- [' x=1, y=2' ] = {' flipv' },
554- [' x=-1, y=2' ] = {' cw' , ' cw' },
555- [' x=-2, y=1' ] = {' ccw' , ' flipv' },
556- [' x=-2, y=-1' ] = {' ccw' },
557- [' x=-1, y=-2' ] = {' fliph' }
558- }
559-
560- -- reduces the list of transformations to a minimal sequence
561- local function reduce_transform (elements )
562- local pos = test_point
563- for _ ,elem in ipairs (elements ) do
564- pos = quickfort_transform .make_transform_fn_from_name (elem )(pos , origin )
565- end
566- local ret = quickfort_transform .resolve_vector (pos , minimal_sequence )
567- if # ret == # elements then
568- -- if we're not making the sequence any shorter, prefer the existing set
569- return elements
570- end
571- return copyall (ret )
572- end
573-
574548function Quickfort :on_transform (val )
575549 table.insert (transformations , val )
576- transformations = reduce_transform (transformations )
577550 self :updateLayout ()
578551 self .dirty = true
579552end
@@ -684,12 +657,18 @@ function Quickfort:onRenderFrame(dc, rect)
684657 -- if the (non-locked) cursor has moved since last preview processing or any
685658 -- settings have changed, regenerate the preview
686659 local cursor = dfhack .gui .getMousePos () or self .saved_cursor
687- if self .dirty or not same_xyz (self .saved_cursor , cursor ) then
688- if not self .cursor_locked then
689- self .saved_cursor = cursor
660+ if not self .cursor_locked and not same_xyz (self .saved_cursor , cursor ) then
661+ self .saved_cursor = cursor
662+ self .last_cursor_move_time = os.clock ()
663+ self .dirty = true
664+ end
665+
666+ if self .dirty then
667+ local now = os.clock ()
668+ if not self .last_cursor_move_time or (now - self .last_cursor_move_time > 0.1 ) then
669+ self :refresh_preview ()
670+ self .dirty = false
690671 end
691- self :refresh_preview ()
692- self .dirty = false
693672 end
694673
695674 local tiles = self .saved_preview .tiles
0 commit comments