Skip to content

Commit

Permalink
fix horizontal separators for fixed-width control panels, #325
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Sep 13, 2022
1 parent f92f082 commit 7d27b43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions js/common/view/population/PopulationPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
*/

import merge from '../../../../../phet-core/js/merge.js';
import { AlignBox, AlignGroup, Text, VBox } from '../../../../../scenery/js/imports.js';
import { AlignBox, AlignGroup, HSeparator, Text, VBox } from '../../../../../scenery/js/imports.js';
import Checkbox from '../../../../../sun/js/Checkbox.js';
import HSeparatorDeprecated from '../../../../../sun/js/HSeparatorDeprecated.js';
import Tandem from '../../../../../tandem/js/Tandem.js';
import naturalSelection from '../../../naturalSelection.js';
import NaturalSelectionStrings from '../../../NaturalSelectionStrings.js';
Expand Down Expand Up @@ -119,7 +118,7 @@ class PopulationPanel extends NaturalSelectionPanel {
children: checkboxes
} ) );

const separator = new HSeparatorDeprecated( options.fixedWidth - 2 * options.xMargin, {
const separator = new HSeparator( {
stroke: NaturalSelectionColors.SEPARATOR_STROKE,
tandem: options.tandem.createTandem( 'separator' )
} );
Expand All @@ -142,6 +141,7 @@ class PopulationPanel extends NaturalSelectionPanel {
dataProbeCheckbox.mouseArea = dataProbeCheckbox.localBounds.dilatedXY( xDilation, yDilation );

const content = new VBox( merge( {}, NaturalSelectionConstants.VBOX_OPTIONS, {
preferredWidth: options.fixedWidth - ( 2 * options.xMargin ),
children: [
checkboxesVBox,
separator,
Expand Down
6 changes: 3 additions & 3 deletions js/common/view/proportions/ProportionsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

import merge from '../../../../../phet-core/js/merge.js';
import AssertUtils from '../../../../../phetcommon/js/AssertUtils.js';
import { Text, VBox } from '../../../../../scenery/js/imports.js';
import { HSeparator, Text, VBox } from '../../../../../scenery/js/imports.js';
import Checkbox from '../../../../../sun/js/Checkbox.js';
import HSeparatorDeprecated from '../../../../../sun/js/HSeparatorDeprecated.js';
import Tandem from '../../../../../tandem/js/Tandem.js';
import naturalSelection from '../../../naturalSelection.js';
import NaturalSelectionStrings from '../../../NaturalSelectionStrings.js';
Expand Down Expand Up @@ -44,7 +43,7 @@ class ProportionsPanel extends NaturalSelectionPanel {
tandem: options.tandem.createTandem( 'legendNode' )
} );

const separator = new HSeparatorDeprecated( options.fixedWidth - 2 * options.xMargin, {
const separator = new HSeparator( {
stroke: NaturalSelectionColors.SEPARATOR_STROKE,
tandem: options.tandem.createTandem( 'separator' )
} );
Expand All @@ -65,6 +64,7 @@ class ProportionsPanel extends NaturalSelectionPanel {
valuesCheckbox.mouseArea = valuesCheckbox.localBounds.dilatedXY( xDilation, yDilation );

const content = new VBox( merge( {}, NaturalSelectionConstants.VBOX_OPTIONS, {
preferredWidth: options.fixedWidth - ( 2 * options.xMargin ),
children: [
legendNode,
separator,
Expand Down

0 comments on commit 7d27b43

Please sign in to comment.