setPaintOpacity (type, val, preventUndo) {
    this.curShape[type + '_opacity'] = val
    if (!preventUndo) {
      this.changeSelectedAttribute(type + '-opacity', val)
    } else {
      this.changeSelectedAttributeNoUndo(type + '-opacity', val)
    }
  }
Sets the current fill/stroke opacity.
@function module:svgcanvas.SvgCanvas#setPaintOpacity
@param {string} type - String with "fill" or "stroke"
@param {Float} val - Float with the new opacity value
@param {boolean} preventUndo - Indicates whether or not this should be an undoable action
@returns {void}