Skip to content

FieldAngle CLOCKWISE and OFFSET apply to all angle pickers simultaneously #2315

@rachel-fenichel

Description

@rachel-fenichel

Problem statement

We allow angle pickers to work in both protractor and compass mode, but whatever mode is picked applies to all angle pickers on the screen.

/* The following two settings work together to set the behaviour of the angle
 * picker.  While many combinations are possible, two modes are typical:
 * Math mode.
 *   0 deg is right, 90 is up.  This is the style used by protractors.
 *   Blockly.FieldAngle.CLOCKWISE = false;
 *   Blockly.FieldAngle.OFFSET = 0;
 * Compass mode.
 *   0 deg is up, 90 is right.  This is the style used by maps.
 *   Blockly.FieldAngle.CLOCKWISE = true;
 *   Blockly.FieldAngle.OFFSET = 90;
 */

/**
 * Angle increases clockwise (true) or counterclockwise (false).
 */
Blockly.FieldAngle.CLOCKWISE = false;

/**
 * Offset the location of 0 degrees (and all angles) by a constant.
 * Usually either 0 (0 = right) or 90 (0 = up).
 */
Blockly.FieldAngle.OFFSET = 0;

Expected Behavior

You can pick on a per-field basis.

Additional Information

Blockly's angle picker doesn't have labels to help orient the user, so it might be confusing to allow these to mix. But if we upgrade the rendering, we may also want to change these properties.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions