Skip to content

Commit

Permalink
Add review comments and minor updates, see #52
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 29, 2022
1 parent 9e161a9 commit 044211b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 2 additions & 3 deletions js/common/view/MeanShareAndBalanceScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ import ResetAllButton from '../../../../scenery-phet/js/buttons/ResetAllButton.j
import MeanShareAndBalanceConstants from '../MeanShareAndBalanceConstants.js';
import meanShareAndBalance from '../../meanShareAndBalance.js';
import MeanShareAndBalanceModel from '../model/MeanShareAndBalanceModel.js';
import PickRequired from '../../../../phet-core/js/types/PickRequired.js';
import { Node, TColor } from '../../../../scenery/js/imports.js';
import QuestionBar from '../../../../scenery-phet/js/QuestionBar.js';
import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js';
// import SyncButton from './SyncButton.js';
import WithRequired from '../../../../phet-core/js/types/WithRequired.js';

export type MeanShareAndBalanceScreenViewOptions = PickRequired<ScreenViewOptions, 'tandem'>;
export type MeanShareAndBalanceScreenViewOptions = WithRequired<ScreenViewOptions, 'tandem'>;

export default class MeanShareAndBalanceScreenView extends ScreenView {
protected readonly resetAllButton: ResetAllButton;
Expand Down
13 changes: 9 additions & 4 deletions js/leveling-out/view/LevelingOutScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import Bounds2 from '../../../../dot/js/Bounds2.js';
import { ScreenViewOptions } from '../../../../joist/js/ScreenView.js';
import TablePlateNode from './TablePlateNode.js';
import StrictOmit from '../../../../phet-core/js/types/StrictOmit.js';
import PickRequired from '../../../../phet-core/js/types/PickRequired.js';
import TableNode from '../../common/view/TableNode.js';
import NoteBookPaperNode from '../../common/view/NoteBookPaperNode.js';
import DraggableChocolate from './DraggableChocolate.js';
Expand All @@ -39,18 +38,17 @@ import Property from '../../../../axon/js/Property.js';
import MeanCalculationDialog from './MeanCalculationDialog.js';

type SelfOptions = EmptySelfOptions;

type LevelingOutScreenViewOptions = SelfOptions & PickRequired<MeanShareAndBalanceScreenViewOptions, 'tandem'> & StrictOmit<ScreenViewOptions, 'children'>;
type LevelingOutScreenViewOptions = SelfOptions & StrictOmit<MeanShareAndBalanceScreenViewOptions, 'children'>;

export default class LevelingOutScreenView extends MeanShareAndBalanceScreenView {

public readonly meanCalculationDialogVisibleProperty: Property<boolean>;

public constructor( model: LevelingOutModel, providedOptions: LevelingOutScreenViewOptions ) {

// REVIEW: Use optionize probably?
const options = providedOptions;


const controlPanel = new LevelingOutControlPanel( model, model.meanCalculationDialogVisibleProperty, {
minContentWidth: MeanShareAndBalanceConstants.MAX_CONTROLS_TEXT_WIDTH + 25,
spacing: 20,
Expand All @@ -60,6 +58,13 @@ export default class LevelingOutScreenView extends MeanShareAndBalanceScreenView
const tableNode = new TableNode( { y: MeanShareAndBalanceConstants.PEOPLE_CENTER_Y } );

const notebookPaper = new NoteBookPaperNode();

// To constrain the dragging of chocolate nodes in the upper area, we need to track the bounds of the paper
// But since the chocolateLayerNode changes its horizontal position to keep things centered for varying
// numbers of people, we must coordinate the drag bounds when that changes.
// This is in the coordinate frame of the chocolateLayerNode.
// This initial value is not in the correct coordinate frame but it is specified correctly before the end of the
// constructor
const notebookPaperBoundsProperty = new Property( notebookPaper.bounds );

// function for what chocolate bars should do at the end of their drag
Expand Down

0 comments on commit 044211b

Please sign in to comment.