@@ -263,7 +263,7 @@ export const drawingMethods = {
263263 h : latAreaHeight
264264 } ;
265265
266- this . drawEditableOutputBackground ( ctx , 'latValueArea' , latAreaX , y_offset_5 - 10 , latAreaWidth , latAreaHeight , [ 248 , 136 , 187 ] ) ;
266+ this . drawEditableValueBackground ( ctx , 'latValueArea' , latAreaX , y_offset_5 - 10 , latAreaWidth , latAreaHeight , [ 248 , 136 , 187 ] ) ;
267267
268268 ctx . fillStyle = this . hoverElement === 'latValueArea' ? "#FAB" : "#F8B" ;
269269 ctx . font = "bold 12px Arial" ;
@@ -289,7 +289,7 @@ export const drawingMethods = {
289289 w : w - ( OUTPUT_VALUE_HIT_RIGHT_INSET - OUTPUT_VALUE_VISUAL_RIGHT_INSET ) ,
290290 h
291291 } ;
292- this . drawEditableOutputBackground ( ctx , controlName , x , y , w , h , hoverColor ) ;
292+ this . drawEditableValueBackground ( ctx , controlName , x , y , w , h , hoverColor ) ;
293293 ctx . fillStyle = this . hoverElement === controlName ? activeTextColor : textColor ;
294294 ctx . textAlign = "center" ;
295295 this . drawVerticallyCenteredText ( ctx , text , x + w / 2 , textY ) ;
@@ -311,15 +311,13 @@ export const drawingMethods = {
311311 ctx . restore ( ) ;
312312 } ,
313313
314- drawEditableOutputBackground ( ctx , controlName , x , y , w , h , color , borderRadius = 5 ) {
314+ drawEditableValueBackground ( ctx , controlName , x , y , w , h , color , borderRadius = 5 ) {
315315 const isHovered = this . hoverElement === controlName ;
316316 ctx . save ( ) ;
317- ctx . fillStyle = isHovered
318- ? `rgba(${ color [ 0 ] } , ${ color [ 1 ] } , ${ color [ 2 ] } , 0.12)`
319- : SECTION_BACKGROUND_COLOR ;
317+ ctx . fillStyle = "rgba(0,0,0,0)" ;
320318 ctx . strokeStyle = isHovered
321319 ? `rgba(${ color [ 0 ] } , ${ color [ 1 ] } , ${ color [ 2 ] } , 0.9)`
322- : "rgba(205, 210, 220, 0.28 )" ;
320+ : "rgba(205, 210, 220, 0.18 )" ;
323321 ctx . lineWidth = isHovered ? 1.4 : 1 ;
324322 ctx . beginPath ( ) ;
325323 ctx . roundRect ( x , y , w , h , borderRadius ) ;
@@ -354,13 +352,13 @@ export const drawingMethods = {
354352 const snapValueX = sliderX + sliderWidth + gap ;
355353 this . controls . snapValueArea = { x : snapValueX , y, w : valueWidth , h : 28 } ;
356354
357- this . drawValueAreaHoverBackground ( ctx , 'snapValueArea' , snapValueX , y , valueWidth , 28 , [ 100 , 150 , 255 ] ) ;
355+ this . drawEditableValueBackground ( ctx , 'snapValueArea' , snapValueX , y , valueWidth , 28 , [ 100 , 150 , 255 ] ) ;
358356
359357 ctx . fillStyle = this . hoverElement === 'snapValueArea' ? "#5af" : "#ccc" ;
360358 ctx . font = "12px Arial" ;
361- ctx . textAlign = "left " ;
359+ ctx . textAlign = "center " ;
362360 ctx . textBaseline = "middle" ;
363- ctx . fillText ( props . snapValue . toString ( ) , snapValueX + 10 , y + 14 ) ;
361+ this . drawVerticallyCenteredText ( ctx , props . snapValue . toString ( ) , snapValueX + valueWidth / 2 , y + 14 ) ;
364362 } ,
365363
366364 draw2DCanvas ( ctx , x , y , w , h , padding = 20 ) {
@@ -1181,12 +1179,12 @@ export const drawingMethods = {
11811179 const valueAreaControl = config . buttonControl . replace ( 'Btn' , 'ValueArea' ) ;
11821180 this . controls [ valueAreaControl ] = { x : currentX , y, w : layout . valueWidth , h : 28 } ;
11831181
1184- this . drawValueAreaHoverBackground ( ctx , valueAreaControl , currentX , y , layout . valueWidth , 28 , [ 100 , 150 , 255 ] ) ;
1182+ this . drawEditableValueBackground ( ctx , valueAreaControl , currentX , y , layout . valueWidth , 28 , [ 100 , 150 , 255 ] ) ;
11851183 this . setCanvasTextStyle ( ctx , {
11861184 fillStyle : this . hoverElement === valueAreaControl ? "#5af" : "#ccc" ,
11871185 textAlign : "center"
11881186 } ) ;
1189- ctx . fillText ( config . displayValue , currentX + layout . valueWidth / 2 , y + 14 ) ;
1187+ this . drawVerticallyCenteredText ( ctx , config . displayValue , currentX + layout . valueWidth / 2 , y + 14 ) ;
11901188 currentX += layout . valueWidth + layout . gap ;
11911189 if ( this . validateWidgets ( ) && config . previewDimensions ) {
11921190 const newW = Math . round ( Number ( config . previewDimensions . width ) || 0 ) ;
0 commit comments