// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/basic/text.cpp
// Function: smooth::GUI::Text::SetFont(smooth::GUI::Font const&)
S::Int S::GUI::Text::SetFont(const Font &nFont)
{
	if (font == nFont) return Success();

	Surface	*surface    = GetDrawSurface();

	Bool	 registered = IsRegistered();
	Bool	 visible    = IsVisible();

	if (registered && visible)
	{
		Rect	 oldRect = Rect(GetRealPosition(), GetRealSize());
		Rect	 newRect = Rect(oldRect.GetPosition(), Size(nFont.GetScaledTextSizeX(text), nFont.GetScaledTextSizeY(text)));

		surface->StartPaint(Rect::EncloseRect(oldRect, newRect));
	}

	Widget::SetFont(nFont);

	SetSize(scaledTextSize * 96.0 / Surface().GetSurfaceDPI() + Size(0, 2));

	Paint(SP_PAINT);

	if (registered && visible) surface->EndPaint();

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
addq $0x140, %rdi            # imm = 0x140
movq -0x18(%rbp), %rsi
callq 0x5da10
testb $0x1, %al
jne 0xa81e4
jmp 0xa8239
leaq -0x28(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x5ca80
movq -0xf0(%rbp), %rdi
callq 0x59680
movl %eax, -0xe4(%rbp)
jmp 0xa8208
movl -0xe4(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5a410
jmp 0xa84fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5a410
jmp 0xa8508
movq -0xe0(%rbp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq -0xe0(%rbp), %rdi
movq %rax, -0x40(%rbp)
movq (%rdi), %rax
callq *0x88(%rax)
movq -0xe0(%rbp), %rdi
andb $0x1, %al
movb %al, -0x41(%rbp)
movq (%rdi), %rax
callq *0x90(%rax)
andb $0x1, %al
movb %al, -0x42(%rbp)
testb $0x1, -0x41(%rbp)
je 0xa835d
testb $0x1, -0x42(%rbp)
je 0xa835d
movq -0xe0(%rbp), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
movq -0xe0(%rbp), %rdi
movq %rax, -0x5c(%rbp)
movq (%rdi), %rax
callq *0x50(%rax)
movq %rax, -0x64(%rbp)
leaq -0x54(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
leaq -0x64(%rbp), %rdx
callq 0x59ff0
leaq -0x54(%rbp), %rdi
callq 0x5d510
movq -0xe0(%rbp), %rsi
movq %rax, -0x7c(%rbp)
movq -0x18(%rbp), %rdi
addq $0xf0, %rsi
callq 0x5ac00
movq -0xe0(%rbp), %rsi
movl %eax, -0xfc(%rbp)
movq -0x18(%rbp), %rdi
addq $0xf0, %rsi
callq 0x5bde0
movl -0xfc(%rbp), %esi
movl %eax, %edx
leaq -0x84(%rbp), %rdi
callq 0x59260
leaq -0x74(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
leaq -0x84(%rbp), %rdx
callq 0x59ff0
movq -0x40(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0x54(%rbp), %rdi
leaq -0x74(%rbp), %rsi
callq 0x5bb40
movq -0xf8(%rbp), %rdi
movq %rax, -0x94(%rbp)
movq %rdx, -0x8c(%rbp)
leaq -0x94(%rbp), %rsi
callq 0x591b0
movq -0xe0(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5a190
movq -0xe0(%rbp), %rdi
addq $0x188, %rdi            # imm = 0x188
movsd 0xdf13d(%rip), %xmm0    # 0x1874c0
callq 0x5a7b0
movq %rax, -0xac(%rbp)
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x59230
movq -0x110(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x5b7d0
movq -0x108(%rbp), %rdi
callq 0x5d470
movw %ax, -0xfe(%rbp)
jmp 0xa83d5
movw -0xfe(%rbp), %ax
cwtl
cvtsi2sd %eax, %xmm0
leaq -0xac(%rbp), %rdi
callq 0x5c6b0
movq %rax, -0x118(%rbp)
jmp 0xa83f6
movq -0x118(%rbp), %rax
movq %rax, -0xa4(%rbp)
leaq -0xc8(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x59260
jmp 0xa8419
leaq -0xa4(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x590b0
movq %rax, -0x120(%rbp)
jmp 0xa8435
movq -0xe0(%rbp), %rdi
movq -0x120(%rbp), %rax
movq %rax, -0x9c(%rbp)
leaq -0x9c(%rbp), %rsi
callq 0x5de18
jmp 0xa8458
leaq -0xb8(%rbp), %rdi
callq 0x5c380
movq -0xe0(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
testb $0x1, -0x41(%rbp)
je 0xa84a4
testb $0x1, -0x42(%rbp)
je 0xa84a4
movq -0x40(%rbp), %rdi
callq 0x5d270
jmp 0xa84a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x5c380
jmp 0xa8508
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x5ca80
movq -0x130(%rbp), %rdi
callq 0x59680
movl %eax, -0x124(%rbp)
jmp 0xa84cb
movl -0x124(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x5a410
jmp 0xa84fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x5a410
jmp 0xa8508
movl -0x4(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)