File tree 2 files changed +26
-25
lines changed
2 files changed +26
-25
lines changed Original file line number Diff line number Diff line change @@ -453,4 +453,30 @@ export var ImguiColorEditMixin =
453
453
454
454
return pressed ;
455
455
} ,
456
+
457
+ // Note: only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set.
458
+ colorTooltip ( text , col , flags )
459
+ {
460
+ let g = this . guictx ;
461
+ this . beginTooltipEx ( 0 , true ) ;
462
+ let label = text . split ( "##" ) [ 0 ] ;
463
+ if ( label . length )
464
+ {
465
+ this . textEx ( label ) ;
466
+ this . Separator ( ) ;
467
+ }
468
+
469
+ let sz = new Vec2 ( g . FontSize * 3 + g . Style . FramePadding . y * 2 ,
470
+ g . FontLineHeight * 3 + g . Style . FramePadding . y * 2 ) ;
471
+ this . ColorButton ( "##preview" , col , ( flags & ( ColorEditFlags . InputMask |
472
+ ColorEditFlags . NoAlpha |
473
+ ColorEditFlags . AlphaPreview |
474
+ ColorEditFlags . AlphaPreviewHalf ) ) |
475
+ ColorEditFlags . NoTooltip ,
476
+ sz ) ;
477
+ this . SameLine ( ) ;
478
+ this . Text ( col . AsMultiStr ( flags & ColorEditFlags . NoAlpha ) ) ;
479
+ this . EndTooltip ( ) ;
480
+ } ,
481
+
456
482
} ;
Original file line number Diff line number Diff line change @@ -436,31 +436,6 @@ export var ImguiColorPickerMixin =
436
436
this . EndPopup ( ) ;
437
437
} ,
438
438
439
- // Note: only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set.
440
- colorTooltip ( text , col , flags )
441
- {
442
- let g = this . guictx ;
443
- this . beginTooltipEx ( 0 , true ) ;
444
- let label = text . split ( "##" ) [ 0 ] ;
445
- if ( label . length )
446
- {
447
- this . textEx ( label ) ;
448
- this . Separator ( ) ;
449
- }
450
-
451
- let sz = new Vec2 ( g . FontSize * 3 + g . Style . FramePadding . y * 2 ,
452
- g . FontLineHeight * 3 + g . Style . FramePadding . y * 2 ) ;
453
- this . ColorButton ( "##preview" , col , ( flags & ( ColorEditFlags . InputMask |
454
- ColorEditFlags . NoAlpha |
455
- ColorEditFlags . AlphaPreview |
456
- ColorEditFlags . AlphaPreviewHalf ) ) |
457
- ColorEditFlags . NoTooltip ,
458
- sz ) ;
459
- this . SameLine ( ) ;
460
- this . Text ( col . AsMultiStr ( flags & ColorEditFlags . NoAlpha ) ) ;
461
- this . EndTooltip ( ) ;
462
- } ,
463
-
464
439
// Helper for ColorPicker4()
465
440
renderArrowsForVerticalBar ( draw_list , pos , half_sz , bar_w )
466
441
{
You can’t perform that action at this time.
0 commit comments