145 lines
7.1 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="API docs for the shouldRepaint method from the TouchPainter class, for the Dart programming language.">
<title>shouldRepaint method - TouchPainter class - TouchPainter library - Dart API</title>
<!-- required because all the links are pseudo-absolute -->
<base href="../..">
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
<link rel="stylesheet" href="static-assets/github.css">
<link rel="stylesheet" href="static-assets/styles.css">
<link rel="icon" href="static-assets/favicon.png">
</head>
<body>
<div id="overlay-under-drawer"></div>
<header id="title">
<button id="sidenav-left-toggle" type="button">&nbsp;</button>
<ol class="breadcrumbs gt-separated dark hidden-xs">
<li><a href="index.html">touch_demonstrator</a></li>
<li><a href="ui_home_TouchPainter/ui_home_TouchPainter-library.html">TouchPainter</a></li>
<li><a href="ui_home_TouchPainter/TouchPainter-class.html">TouchPainter</a></li>
<li class="self-crumb">shouldRepaint method</li>
</ol>
<div class="self-name">shouldRepaint</div>
<form class="search navbar-right" role="search">
<input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
</form>
</header>
<main>
<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
<h5>TouchPainter class</h5>
<ol>
<li class="section-title"><a href="ui_home_TouchPainter/TouchPainter-class.html#constructors">Constructors</a></li>
<li><a href="ui_home_TouchPainter/TouchPainter/TouchPainter.html">TouchPainter</a></li>
<li class="section-title">
<a href="ui_home_TouchPainter/TouchPainter-class.html#instance-properties">Properties</a>
</li>
<li><a href="ui_home_TouchPainter/TouchPainter/context.html">context</a></li>
<li><a href="ui_home_TouchPainter/TouchPainter/touchCollection.html">touchCollection</a></li>
<li><a href="ui_home_TouchPainter/TouchPainter/width.html">width</a></li>
<li class="inherited"><a href="ui_home_TouchPainter/TouchPainter/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="ui_home_TouchPainter/TouchPainter/runtimeType.html">runtimeType</a></li>
<li class="inherited"><a href="ui_home_TouchPainter/TouchPainter/semanticsBuilder.html">semanticsBuilder</a></li>
<li class="section-title"><a href="ui_home_TouchPainter/TouchPainter-class.html#instance-methods">Methods</a></li>
<li><a href="ui_home_TouchPainter/TouchPainter/paint.html">paint</a></li>
<li><a href="ui_home_TouchPainter/TouchPainter/shouldRepaint.html">shouldRepaint</a></li>
<li class="inherited"><a href="ui_home_TouchPainter/TouchPainter/addListener.html">addListener</a></li>
<li class="inherited"><a href="ui_home_TouchPainter/TouchPainter/hitTest.html">hitTest</a></li>
<li class="inherited"><a href="ui_home_TouchPainter/TouchPainter/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="ui_home_TouchPainter/TouchPainter/removeListener.html">removeListener</a></li>
<li class="inherited"><a href="ui_home_TouchPainter/TouchPainter/shouldRebuildSemantics.html">shouldRebuildSemantics</a></li>
<li class="inherited"><a href="ui_home_TouchPainter/TouchPainter/toString.html">toString</a></li>
<li class="section-title inherited"><a href="ui_home_TouchPainter/TouchPainter-class.html#operators">Operators</a></li>
<li class="inherited"><a href="ui_home_TouchPainter/TouchPainter/operator_equals.html">operator ==</a></li>
<li class="section-title"><a href="ui_home_TouchPainter/TouchPainter-class.html#static-properties">Static properties</a></li>
<li><a href="ui_home_TouchPainter/TouchPainter/buttonPressed.html">buttonPressed</a></li>
<li><a href="ui_home_TouchPainter/TouchPainter/buttonReleased.html">buttonReleased</a></li>
</ol>
</div><!--/.sidebar-offcanvas-->
<div class="col-xs-12 col-sm-9 col-md-8 main-content">
<h1>shouldRepaint method</h1>
<section class="multi-line-signature">
<div>
<ol class="annotation-list">
<li>@override</li>
</ol>
</div>
<span class="returntype">bool</span>
<span class="name ">shouldRepaint</span>
(<wbr><span class="parameter" id="shouldRepaint-param-oldDelegate"><span>covariant</span> <span class="type-annotation">CustomPainter</span> <span class="parameter-name">oldDelegate</span></span>)
</section>
<section class="desc markdown">
<p>Called whenever a new instance of the custom painter delegate class is
provided to the <code>RenderCustomPaint</code> object, or any time that a new
<code>CustomPaint</code> object is created with a new instance of the custom painter
delegate class (which amounts to the same thing, because the latter is
implemented in terms of the former).</p>
<p>If the new instance represents different information than the old
instance, then the method should return true, otherwise it should return
false.</p>
<p>If the method returns false, then the <a href="ui_home_TouchPainter/TouchPainter/paint.html">paint</a> call might be optimized
away.</p>
<p>It's possible that the <a href="ui_home_TouchPainter/TouchPainter/paint.html">paint</a> method will get called even if
<a href="ui_home_TouchPainter/TouchPainter/shouldRepaint.html">shouldRepaint</a> returns false (e.g. if an ancestor or descendant needed to
be repainted). It's also possible that the <a href="ui_home_TouchPainter/TouchPainter/paint.html">paint</a> method will get called
without <a href="ui_home_TouchPainter/TouchPainter/shouldRepaint.html">shouldRepaint</a> being called at all (e.g. if the box changes
size).</p>
<p>If a custom delegate has a particularly expensive paint function such that
repaints should be avoided as much as possible, a <code>RepaintBoundary</code> or
<code>RenderRepaintBoundary</code> (or other render object with
<code>RenderObject.isRepaintBoundary</code> set to true) might be helpful.</p>
<p>The <code>oldDelegate</code> argument will never be null.</p>
</section>
<section class="summary source-code" id="source">
<h2><span>Implementation</span> </h2>
<pre class="language-dart"><code class="language-dart">@override
bool shouldRepaint(CustomPainter oldDelegate) {
return true;
}</code></pre>
</section>
</div> <!-- /.main-content -->
<div class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
</div><!--/.sidebar-offcanvas-->
</main>
<footer>
<span class="no-break">
touch_demonstrator 1.0.0+1
</span>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="static-assets/typeahead.bundle.min.js"></script>
<script src="static-assets/highlight.pack.js"></script>
<script src="static-assets/URI.js"></script>
<script src="static-assets/script.js"></script>
</body>
</html>