Skip to content

Commit

Permalink
add support for dynamic layout on Chart Intro screen, phetsims/build-…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jul 31, 2023
1 parent 05001ae commit 251b9f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/nodes/RichText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export type RichTextHref = ( () => void ) | string;
type RichTextLinksObject = Record<string, RichTextHref>;
export type RichTextLinks = RichTextLinksObject | true;

// Used only for guarding against assertions, we want to know that we aren't in dynamic stringTest mode
const isNotDynamicStringTest = !_.hasIn( window, 'phet.chipper.queryParameters' ) || window.phet.chipper.queryParameters.stringTest !== 'dynamic';
// Used only for guarding against assertions, we want to know that we aren't in stringTesting mode
const isStringTest = window.QueryStringMachine && QueryStringMachine.containsKey( 'stringTest' );

type SelfOptions = {
// Sets how bounds are determined for text
Expand Down Expand Up @@ -582,12 +582,12 @@ export default class RichText extends Node {
if ( assert ) {
if ( this._links && this._links !== true ) {
Object.keys( this._links ).forEach( link => {
assert && allowLinksProperty.value && isNotDynamicStringTest && assert( usedLinks.includes( link ), `Unused RichText link: ${link}` );
assert && allowLinksProperty.value && !isStringTest && assert( usedLinks.includes( link ), `Unused RichText link: ${link}` );
} );
}
if ( this._nodes ) {
Object.keys( this._nodes ).forEach( node => {
assert && allowLinksProperty.value && isNotDynamicStringTest && assert( usedNodes.includes( node ), `Unused RichText node: ${node}` );
assert && allowLinksProperty.value && !isStringTest && assert( usedNodes.includes( node ), `Unused RichText node: ${node}` );
} );
}
}
Expand Down

0 comments on commit 251b9f5

Please sign in to comment.