-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
type for styling group focus highlights from node, see #708
- Loading branch information
1 parent
84c59ea
commit 7c47eb9
Showing
2 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2017, University of Colorado Boulder | ||
|
||
/** | ||
* A FocusHighlightPath subtype that is based around a Node, with styling that makes it look like a group focus | ||
* highlight. | ||
* | ||
* @author Jesse Greenberg (PhET Interactive Simulations) | ||
*/ | ||
define( function( require ) { | ||
'use strict'; | ||
|
||
// modules | ||
var FocusHighlightFromNode = require( 'SCENERY/accessibility/FocusHighlightFromNode' ); | ||
var FocusHighlightPath = require( 'SCENERY/accessibility/FocusHighlightPath' ); | ||
var inherit = require( 'PHET_CORE/inherit' ); | ||
var scenery = require( 'SCENERY/scenery' ); | ||
|
||
/** | ||
* | ||
* @param {Node|null} node | ||
* @param {Object} [options] | ||
* @constructor | ||
*/ | ||
function GroupFocusHighlightFromNode( node, options ) { | ||
|
||
options = _.extend( { | ||
outerStroke: FocusHighlightPath.OUTER_LIGHT_GROUP_FOCUS_COLOR, | ||
innerStroke: FocusHighlightPath.INNER_LIGHT_GROUP_FOCUS_COLOR, | ||
|
||
outerLineWidth: FocusHighlightPath.GROUP_OUTER_LINE_WIDTH, | ||
innerLineWidth: FocusHighlightPath.GROUP_INNER_LINE_WIDTH, | ||
|
||
useGroupDilation: true | ||
}, options ); | ||
|
||
FocusHighlightFromNode.call( this, node, options ); | ||
} | ||
|
||
scenery.register( 'GroupFocusHighlightFromNode', GroupFocusHighlightFromNode ); | ||
|
||
return inherit( FocusHighlightFromNode, GroupFocusHighlightFromNode ); | ||
} ); |