Skip to content

Commit

Permalink
Dilate Checkbox vertical touch areas, see #239
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisklus committed Sep 4, 2019
1 parent 52d8adc commit 2c5140f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions js/common/EFACConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ define( require => {
ENERGY_SYMBOLS_PANEL_CORNER_RADIUS: 6,
ENERGY_SYMBOLS_PANEL_MIN_WIDTH: 215,
ENERGY_SYMBOLS_PANEL_TEXT_MAX_WIDTH: 180,
ENERGY_SYMBOLS_PANEL_CHECKBOX_Y_DILATION: 5,
CONTROL_PANEL_CORNER_RADIUS: 10,
RESET_ALL_BUTTON_RADIUS: 20,
PLAY_PAUSE_BUTTON_RADIUS: 20,
Expand Down
6 changes: 5 additions & 1 deletion js/intro/view/EFACIntroScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,8 @@ define( require => {
spacing: 5
} ), model.energyChunksVisibleProperty
);
showEnergyCheckbox.touchArea =
showEnergyCheckbox.localBounds.dilatedY( EFACConstants.ENERGY_SYMBOLS_PANEL_CHECKBOX_Y_DILATION );

// Create the control for linking/un-linking the heaters
const flameNode = new Image( flameImage, {
Expand All @@ -619,11 +621,13 @@ define( require => {
spacing: 5
} ), model.linkedHeatersProperty
);
linkHeatersCheckbox.touchArea =
linkHeatersCheckbox.localBounds.dilatedY( EFACConstants.ENERGY_SYMBOLS_PANEL_CHECKBOX_Y_DILATION );

// Add the checkbox controls
const controlPanelCheckboxes = new VBox( {
children: [ showEnergyCheckbox, linkHeatersCheckbox ],
spacing: 8,
spacing: 10,
align: 'left'
} );
const controlPanel = new Panel( controlPanelCheckboxes, {
Expand Down
2 changes: 2 additions & 0 deletions js/systems/view/SystemsScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ define( require => {
} ),
model.energyChunksVisibleProperty
);
showEnergyChunksCheckbox.touchArea =
showEnergyChunksCheckbox.localBounds.dilatedY( EFACConstants.ENERGY_SYMBOLS_PANEL_CHECKBOX_Y_DILATION );

// add the checkbox that controls the visibility of the energy chunks to a panel
const showEnergyChunksPanel = new Panel( showEnergyChunksCheckbox, {
Expand Down

0 comments on commit 2c5140f

Please sign in to comment.