1// Copyright 2013 The Flutter Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5part of engine; 6 7bool rectIsValid(ui.Rect rect) { 8 assert(rect != null, 'Rect argument was null.'); 9 assert( 10 !(rect.left.isNaN || 11 rect.right.isNaN || 12 rect.top.isNaN || 13 rect.bottom.isNaN), 14 'Rect argument contained a NaN value.'); 15 return true; 16} 17 18bool rrectIsValid(ui.RRect rrect) { 19 assert(rrect != null, 'RRect argument was null.'); 20 assert( 21 !(rrect.left.isNaN || 22 rrect.right.isNaN || 23 rrect.top.isNaN || 24 rrect.bottom.isNaN), 25 'RRect argument contained a NaN value.'); 26 return true; 27} 28 29bool offsetIsValid(ui.Offset offset) { 30 assert(offset != null, 'Offset argument was null.'); 31 assert(!offset.dx.isNaN && !offset.dy.isNaN, 32 'Offset argument contained a NaN value.'); 33 return true; 34} 35 36bool matrix4IsValid(Float64List matrix4) { 37 assert(matrix4 != null, 'Matrix4 argument was null.'); 38 assert(matrix4.length == 16, 'Matrix4 must have 16 entries.'); 39 return true; 40} 41 42bool radiusIsValid(ui.Radius radius) { 43 assert(radius != null, 'Radius argument was null.'); 44 assert(!radius.x.isNaN && !radius.y.isNaN, 45 'Radius argument contained a NaN value.'); 46 return true; 47} 48