Skip to content

Commit

Permalink
Refactor drag speed options and improve visibility property constants…
Browse files Browse the repository at this point in the history
… in drag interaction views, see: #77
  • Loading branch information
marlitas committed Jan 31, 2025
1 parent 1189a64 commit edf951a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions js/common/view/GroupSelectDragInteractionView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export default class GroupSelectDragInteractionView extends GroupSelectView<Coun
super( groupSelectModel, primaryFocusedNode, options );

const keyboardListenerOptions = combineOptions<SoundKeyboardDragListenerOptions>( {
dragSpeed: 180,
shiftDragSpeed: 90,
enabledProperty: groupSelectModel.isGroupItemKeyboardGrabbedProperty,
tandem: options.tandem.createTandem( 'keyboardDragListener' )
}, options.soundKeyboardDragListenerOptions );
Expand Down
5 changes: 3 additions & 2 deletions js/common/view/NumberBondAccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import NumberBondNode, { NumberBondNodeOptions } from './NumberBondNode.js';
import TotalRepresentationAccordionBox, { TotalRepresentationAccordionBoxOptions } from './TotalRepresentationAccordionBox.js';
import BarModelNode from './BarModelNode.js';
import DerivedProperty from '../../../../axon/js/DerivedProperty.js';
import { NumberModelType } from './NumberModelTypeControl.js';

type SelfOptions = {
numberBondNodeOptions?: NumberBondNodeOptions;
Expand All @@ -43,11 +44,11 @@ export default class NumberBondAccordionBox extends TotalRepresentationAccordion
}, providedOptions );

const numberBondOptions = combineOptions<NumberBondNodeOptions>( {
visibleProperty: DerivedProperty.valueEqualsConstant( NumberPairsConstants.NUMBER_MODEL_TYPE_PROPERTY, 'numberBondModel' )
visibleProperty: DerivedProperty.valueEqualsConstant( NumberPairsConstants.NUMBER_MODEL_TYPE_PROPERTY, NumberModelType.NUMBER_BOND_MODEL )
}, options.numberBondNodeOptions );
const numberBondNode = new NumberBondNode( model, numberBondOptions );
const barModelNode = new BarModelNode( model, {
visibleProperty: DerivedProperty.valueEqualsConstant( NumberPairsConstants.NUMBER_MODEL_TYPE_PROPERTY, 'barModel' )
visibleProperty: DerivedProperty.valueEqualsConstant( NumberPairsConstants.NUMBER_MODEL_TYPE_PROPERTY, NumberModelType.BAR_MODEL )
} );
const contentNode = new Node( {
children: [ numberBondNode, barModelNode ],
Expand Down

0 comments on commit edf951a

Please sign in to comment.