@@ -46,7 +46,10 @@ export function drawGridHeaders(
46
46
ctx . fillStyle = outerTheme . bgHeader ;
47
47
ctx . fillRect ( 0 , 0 , width , totalHeaderHeight ) ;
48
48
49
- const [ hCol , hRow ] = hovered ?. [ 0 ] ?? [ ] ;
49
+ const hCol = hovered ?. [ 0 ] ?. [ 0 ] ;
50
+ const hRow = hovered ?. [ 0 ] ?. [ 1 ] ;
51
+ const hPosX = hovered ?. [ 1 ] ?. [ 0 ] ;
52
+ const hPosY = hovered ?. [ 1 ] ?. [ 1 ] ;
50
53
51
54
const font = outerTheme . headerFontFull ;
52
55
// Assinging the context font too much can be expensive, it can be worth it to minimze this
@@ -115,6 +118,8 @@ export function drawGridHeaders(
115
118
selected ,
116
119
theme ,
117
120
hoveredBoolean ,
121
+ hoveredBoolean ? hPosX : undefined ,
122
+ hoveredBoolean ? hPosY : undefined ,
118
123
hasSelectedCell ,
119
124
hover ,
120
125
spriteManager ,
@@ -415,6 +420,8 @@ function drawHeaderInner(
415
420
selected : boolean ,
416
421
theme : FullTheme ,
417
422
isHovered : boolean ,
423
+ posX : number | undefined ,
424
+ posY : number | undefined ,
418
425
hoverAmount : number ,
419
426
spriteManager : SpriteManager ,
420
427
touchMode : boolean ,
@@ -533,6 +540,12 @@ function drawHeaderInner(
533
540
if ( shouldDrawMenu && headerLayout . menuBounds !== undefined ) {
534
541
const menuBounds = headerLayout . menuBounds ;
535
542
543
+ const hovered = posX !== undefined && posY !== undefined && pointInRect ( menuBounds , posX + x , posY + y ) ;
544
+
545
+ if ( ! hovered ) {
546
+ ctx . globalAlpha = 0.7 ;
547
+ }
548
+
536
549
if ( c . menuIcon === undefined || c . menuIcon === GridColumnMenuIcon . Triangle ) {
537
550
// Draw the default triangle menu icon:
538
551
ctx . beginPath ( ) ;
@@ -572,6 +585,10 @@ function drawHeaderInner(
572
585
const iconY = menuBounds . y + ( menuBounds . height - theme . headerIconSize ) / 2 ;
573
586
spriteManager . drawSprite ( c . menuIcon , "normal" , ctx , iconX , iconY , theme . headerIconSize , theme ) ;
574
587
}
588
+
589
+ if ( ! hovered ) {
590
+ ctx . globalAlpha = 1 ;
591
+ }
575
592
}
576
593
}
577
594
@@ -585,6 +602,8 @@ export function drawHeader(
585
602
selected : boolean ,
586
603
theme : FullTheme ,
587
604
isHovered : boolean ,
605
+ posX : number | undefined ,
606
+ posY : number | undefined ,
588
607
hasSelectedCell : boolean ,
589
608
hoverAmount : number ,
590
609
spriteManager : SpriteManager ,
@@ -620,6 +639,8 @@ export function drawHeader(
620
639
selected ,
621
640
theme ,
622
641
isHovered ,
642
+ posX ,
643
+ posY ,
623
644
hoverAmount ,
624
645
spriteManager ,
625
646
touchMode ,
@@ -638,6 +659,8 @@ export function drawHeader(
638
659
selected ,
639
660
theme ,
640
661
isHovered ,
662
+ posX ,
663
+ posY ,
641
664
hoverAmount ,
642
665
spriteManager ,
643
666
touchMode ,
0 commit comments