import { colorToRgba , overrideOpacity } from '../../../../../common/color_library_wrappers' ; import { Fill , Stroke } from '../../../../../geoms/types' ; import { Rotation } from '../../../../../utils/common' ; import { Dimensions } from '../../../../../utils/dimensions' ; import { RectAnnotationStyle } from '../../../../../utils/themes/theme' ; import { AnnotationRectProps } from '../../../annotations/rect/types' ; import { renderRect } from '../primitives/rect' ; import { withPanelTransform } from '../utils/panel_transform' ; internal export function renderRectAnnotations ( ctx , annotations , rectStyle , rotation , renderingArea ) { const fill = { color : overrideOpacity ( colorToRgba ( rectStyle . fill ) , ( opacity ) => opacity * rectStyle . opacity ) , } ; const stroke = { color : overrideOpacity ( colorToRgba ( rectStyle . stroke ) , ( opacity ) => opacity * rectStyle . opacity ) , width : rectStyle . strokeWidth , } ; annotations . forEach ( ( { rect , panel } ) => withPanelTransform ( ctx , panel , rotation , renderingArea , ( ) => renderRect ( ctx , rect , fill , stroke ) ) ) ; }