mirror of
				https://github.com/nicbarker/clay.git
				synced 2025-11-04 00:26:17 +00:00 
			
		
		
		
	[Core] Update debug tools to include text alignment
This commit is contained in:
		
							parent
							
								
									d637e2a122
								
							
						
					
					
						commit
						e35bba079e
					
				| 
						 | 
				
			
			@ -96,6 +96,12 @@ TextWrapMode :: enum EnumBackingType {
 | 
			
		|||
    None,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TextAlignment :: enum EnumBackingType {
 | 
			
		||||
    Left,
 | 
			
		||||
    Center,
 | 
			
		||||
    Right,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TextElementConfig :: struct {
 | 
			
		||||
    textColor:          Color,
 | 
			
		||||
    fontId:             u16,
 | 
			
		||||
| 
						 | 
				
			
			@ -103,6 +109,7 @@ TextElementConfig :: struct {
 | 
			
		|||
    letterSpacing:      u16,
 | 
			
		||||
    lineHeight:         u16,
 | 
			
		||||
    wrapMode:           TextWrapMode,
 | 
			
		||||
    textAlignment:      TextAlignment,
 | 
			
		||||
    hashStringContents: bool,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										11
									
								
								clay.h
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								clay.h
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -3346,7 +3346,7 @@ void Clay__RenderDebugView(void) {
 | 
			
		|||
                                // .letterSpacing
 | 
			
		||||
                                CLAY_TEXT(CLAY_STRING("Letter Spacing"), infoTitleConfig);
 | 
			
		||||
                                CLAY_TEXT(Clay__IntToString(textConfig->letterSpacing), infoTextConfig);
 | 
			
		||||
                                // .lineSpacing
 | 
			
		||||
                                // .wrapMode
 | 
			
		||||
                                CLAY_TEXT(CLAY_STRING("Wrap Mode"), infoTitleConfig);
 | 
			
		||||
                                Clay_String wrapMode = CLAY_STRING("WORDS");
 | 
			
		||||
                                if (textConfig->wrapMode == CLAY_TEXT_WRAP_NONE) {
 | 
			
		||||
| 
						 | 
				
			
			@ -3355,6 +3355,15 @@ void Clay__RenderDebugView(void) {
 | 
			
		|||
                                    wrapMode = CLAY_STRING("NEWLINES");
 | 
			
		||||
                                }
 | 
			
		||||
                                CLAY_TEXT(wrapMode, infoTextConfig);
 | 
			
		||||
                                // .textAlignment
 | 
			
		||||
                                CLAY_TEXT(CLAY_STRING("Text Alignment"), infoTitleConfig);
 | 
			
		||||
                                Clay_String textAlignment = CLAY_STRING("LEFT");
 | 
			
		||||
                                if (textConfig->textAlignment == CLAY_TEXT_ALIGN_CENTER) {
 | 
			
		||||
                                    textAlignment = CLAY_STRING("CENTER");
 | 
			
		||||
                                } else if (textConfig->textAlignment == CLAY_TEXT_ALIGN_RIGHT) {
 | 
			
		||||
                                    textAlignment = CLAY_STRING("RIGHT");
 | 
			
		||||
                                }
 | 
			
		||||
                                CLAY_TEXT(textAlignment, infoTextConfig);
 | 
			
		||||
                                // .textColor
 | 
			
		||||
                                CLAY_TEXT(CLAY_STRING("Text Color"), infoTitleConfig);
 | 
			
		||||
                                Clay__RenderDebugViewColor(textConfig->textColor, infoTextConfig);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							
		Loading…
	
		Reference in a new issue