// Copyright (c) 2015 The Chromium Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.part ofcassowary;classPriority{staticfinaldoublerequired=create(1e3,1e3,1e3);staticfinaldoublestrong=create(1.0,0.0,0.0);staticfinaldoublemedium=create(0.0,1.0,0.0);staticfinaldoubleweak=create(0.0,0.0,1.0);staticdoublecreate(doublea,doubleb,doublec){doubleresult=0.0;result+=max(0.0,min(1e3,a))*1e6;result+=max(0.0,min(1e3,b))*1e3;result+=max(0.0,min(1e3,c));returnresult;}staticdoubleclamp(doublevalue){returnmax(0.0,min(required,value));}}