blockly > geras > Highlighter

geras.Highlighter class

An object that adds highlights to a block based on the given rendering information.

Highlighting is interesting because the highlights do not fully enclose the block. Instead, they are positioned based on a light source in the top left. This means that rendering highlights requires exact information about the position of each part of the block. The resulting paths are not continuous or closed paths. The highlights for tabs and notches are loosely based on tab and notch shapes, but are not exactly the same.

Signature:

export declare class Highlighter 

Constructors

Constructor Modifiers Description
(constructor)(info) Constructs a new instance of the Highlighter class

Properties

Property Modifiers Type Description
constants_ ConstantProvider
highlightConstants_ HighlightConstantProvider
info_ RenderInfo
inlineSteps_ string
insideCornerPaths_ InsideCorner
jaggedTeethPaths_ JaggedTeeth
notchPaths_ Notch
outsideCornerPaths_ OutsideCorner
puzzleTabPaths_ PuzzleTab
RTL_ boolean
startPaths_ StartHat
steps_ string

Methods

Method Modifiers Description
drawBottomRow(row) Add a highlight to the bottom row.
drawInlineInput(input) Add a highlight to an inline input.
drawJaggedEdge_(row) Add a highlight on a jagged edge for a collapsed block.
drawLeft() Draw the highlight on the left side of the block.
drawRightSideRow(row) Add a highlight on the right side of a row.
drawStatementInput(row) Add a highlight on a statement input.
drawTopCorner(row) Add a highlight to the top corner of a block.
drawValueInput(row) Add a highlight on a value input.
getPath() Get the steps for the highlight path.