# WindowMixin

## core. WindowMixin

Source:
  - core/WindowMixin.js, line 10

This mixin implements various unit-handling measurement methods.

Note: (a) this is the equivalent of PsychoPY's WindowMixin. (b) it will most probably be made obsolete by a fully-integrated unit approach.

### Methods

#### (protected) _getHorLengthPix(length) → {number}

Source:
  - core/WindowMixin.js, line 115

Convert the given length from stimulus units to pixel units

##### Parameters:

Name | Type | Description
--- | --- | ---
`length` | number | the length in stimulus units

##### Returns:

- the length in pixels

Type
  number

#### (protected) _getLengthPix(length, integerCoordinatesopt) → {number}

Source:
  - core/WindowMixin.js, line 29

Convert the given length from stimulus unit to pixel units.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`length` | number |  |  | the length in stimulus units
`integerCoordinates` | boolean | <optional> | `false` | whether or not to round the length.

##### Returns:

- the length in pixel units

Type
  number

#### (protected) _getLengthUnits(length_px) → {number}

Source:
  - core/WindowMixin.js, line 78

Convert the given length from pixel units to the stimulus units

##### Parameters:

Name | Type | Description
--- | --- | ---
`length_px` | number | the length in pixel units

##### Returns:

- the length in stimulus units

Type
  number

#### (protected) _getVerLengthPix(length) → {number}

Source:
  - core/WindowMixin.js, line 152

Convert the given length from pixel units to the stimulus units

##### Parameters:

Name | Type | Description
--- | --- | ---
`length` | number | the length in pixel units

##### Returns:

- the length in stimulus units

Type
  number