Class

RectDrawer (minimap)

@ckeditor/ckeditor5-minimap/src/utils

class protected

A helper class that makes it possible to visualize rect objects.

TODO: Move this class to shared utils.

Filtering

Properties

Static properties

  • _defaultStyles : Object

    private static

  • _domElements : Array.<HTMLElement>

    private static

  • _stylesElement : HTMLElement | null

    private static

Methods

Static methods

  • clear()

    static

    Clears all previously drawn rects.

  • draw( rect, [ userStyles ], [ name ] )

    static

    Draws a rect object on the screen.

    const rect = new Rect( domElement );
    
    // Simple usage.
    RectDrawer.draw( rect );
    
    // With custom styles.
    RectDrawer.draw( rect, { outlineWidth: '3px', opacity: '.8' } );
    
    // With custom styles and a name.
    RectDrawer.draw( rect, { outlineWidth: '3px', opacity: '.8' }, 'Main element' );
    

    Note: In most cases, drawing a rect should be preceded by clear.

    Parameters

    rect : Rect

    The rect to be drawn.

    [ userStyles ] : Object

    An optional object with custom styles for the rect.

    [ name ] : String

    The optional name of the rect.

  • _injectStyles()

    private static