如何防止sceneFunc()每次清除上下文?

时间:2016-04-10 09:14:38

标签: ios canvas html5-canvas kineticjs konvajs

KonvaJS sceneFunc()定义任何Shape draw()会导致每次调用Shape.draw()时调用它,

  1. layer.draw()
  2. stage.draw()
  3. sceneFunc()
  4. 问题是:如何阻止use strict; use warnings; use 5.020; use autodie; use Data::Dumper; open my $FILE1, "<", "file1.txt"; open my $FILE2, "<", "file2.txt"; open my $OUTFILE, ">", "results.txt"; my $first_line = <$FILE1>; close $FILE1; my @line_prefixes = split /\s*:\s*/, $first_line; while (my $line = <$FILE2>) { print {$OUTFILE} "$line_prefixes[$. - 1]: $line"; } close $FILE2; close $OUTFILE; 清除上下文并在之前的调用中保留过去的图纸?

1 个答案:

答案 0 :(得分:1)

您可以使用clearBeforeDraw属性:

var layer = new Konva.Layer({clearBeforeDraw: false});

来自docs:

  如果您不想清除画布,请将此属性设置为false   在每层之前绘制。默认值为true。