typograph-editor-documentation
    Preparing search index...

    Class Popupmenu_canvas

    Hierarchy (View Summary)

    Index
    _hidemenu: any = ...
    _selectmenu: any = ...
    active: boolean
    arrow: HTMLElement
    canvaselement: HTMLCanvasElement
    container: HTMLElement
    dashes: menuitemdata_dash[] = []
    dialog: Dialog = null
    element: HTMLElement
    id: string
    lineWidth: number
    menucontoler: MenuControler
    menuitems: menuitemdata[]
    popupmenuwidth: number = 200
    removeunderscore: boolean = true
    strokedash: stroke_dash
    strokeStyle: string
    title: string
    title_view: CanvasView
    translate: boolean = false

    Show the title and the items in the user's language (TYP-1287). Only for a menu of the editor's own choices — alignments, fit modes, blend modes. Never for one that lists a document's fonts, styles or swatches: those are names, not words to translate.

    type: string
    width: number
    • Parameters

      • view: CanvasView
      • pattern: number[] = []

      Returns void

    • ⚠️ This must not be able to throw on its own argument.

      Titles come from a document — a font family, a style name, a swatch name — and any of them can be absent in a document that is merely unusual rather than broken. It used to call this.title.split() on whatever arrived, so one run whose font resolved to nothing threw here and the toolbar never finished building: clicking into a text frame took the editor down (TYP-739). A menu with nothing to show should show nothing.

      The parameter's type is widened to say what actually reaches it. The element lookup below is deliberately NOT guarded: a missing title element means this menu was built with the wrong id, which is a wiring mistake and should stay loud.

      Parameters

      • i: string
      • removeunderscore: boolean = true

      Returns void

    • Parameters

      • strokedash: stroke_dash

      Returns void