File tree Expand file tree Collapse file tree
editor/src/messages/portfolio/document/overlays Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -983,6 +983,11 @@ impl OverlayContextInternal {
983983 let mut data = vec ! [ 0u8 ; ( PATTERN_WIDTH * PATTERN_HEIGHT * 4 ) as usize ] ;
984984 let rgba = color. to_rgba8_srgb ( ) ;
985985
986+ // ┌▄▄┬──┬──┬──┐
987+ // ├▀▀┼──┼──┼──┤
988+ // ├──┼──┼▄▄┼──┤
989+ // ├──┼──┼▀▀┼──┤
990+ // └──┴──┴──┴──┘
986991 // Set pixels at (0,0) and (2,2) to the specified color
987992 let pixels = [ ( 0 , 0 ) , ( 2 , 2 ) ] ;
988993 for & ( x, y) in & pixels {
@@ -1065,9 +1070,9 @@ impl OverlayContextInternal {
10651070 Pivot :: End => position. x = -padding - text_width,
10661071 }
10671072 match pivot[ 1 ] {
1068- Pivot :: Start => position. y = padding + text_height * 0.8 , // Account for baseline
1069- Pivot :: Middle => position. y = text_height * 0.3 , // Center on x-height
1070- Pivot :: End => position. y = -padding - text_height * 0.2 ,
1073+ Pivot :: Start => position. y = padding,
1074+ Pivot :: Middle => position. y - = text_height * 0.5 ,
1075+ Pivot :: End => position. y = -padding - text_height,
10711076 }
10721077
10731078 let text_transform = transform * DAffine2 :: from_translation ( position) ;
You can’t perform that action at this time.
0 commit comments