<commit_before>#include <stdafx.h>
#include "Canvas.h"

void CCanvas::DrawRectangle( HDC hdc, TBox box, COLORREF color ) const
{
    HBRUSH brush = ::CreateSolidBrush( color );
    ::FillRect( hdc, &box, brush );
    ::DeleteObject( brush );
}

void CCanvas::DrawEllipse( HDC hdc, TBox box, COLORREF color ) const
{
    HBRUSH brush = ::CreateSolidBrush( color );
    HBRUSH brushOld = static_cast<HBRUSH>(::SelectObject( hdc, brush ));
    ::Ellipse( hdc, box.left, box.top, box.right, box.bottom );
    ::SelectObject( hdc, brushOld );
    ::DeleteObject( brush );
}

void CCanvas::DrawTextBox( HDC hdc, TBox box, COLORREF color, const std::wstring& text, UINT format ) const
{
    COLORREF colorOld = ::SetTextColor( hdc, color );
    ::DrawText( hdc, text.c_str(), -1, &box, format );
    ::SetTextColor( hdc, colorOld );
}
<commit_msg>Fixed drawing of textbox. Made background transparent.<commit_after>#include <stdafx.h>
#include "Canvas.h"

void CCanvas::DrawRectangle( HDC hdc, TBox box, COLORREF color ) const
{
    HBRUSH brush = ::CreateSolidBrush( color );
    ::FillRect( hdc, &box, brush );
    ::DeleteObject( brush );
}

void CCanvas::DrawEllipse( HDC hdc, TBox box, COLORREF color ) const
{
    HBRUSH brush = ::CreateSolidBrush( color );
    HBRUSH brushOld = static_cast<HBRUSH>(::SelectObject( hdc, brush ));
    ::Ellipse( hdc, box.left, box.top, box.right, box.bottom );
    ::SelectObject( hdc, brushOld );
    ::DeleteObject( brush );
}

void CCanvas::DrawTextBox( HDC hdc, TBox box, COLORREF color, const std::wstring& text, UINT format ) const
{
	int bkModeOld = ::SetBkMode(hdc, TRANSPARENT);
    COLORREF colorOld = ::SetTextColor( hdc, color );
    ::DrawText( hdc, text.c_str(), -1, &box, format );
    ::SetTextColor( hdc, colorOld );
	::SetBkMode(hdc, bkModeOld);
}

{'fraction_non_alphanumeric': 0.14952751528627015, 'fraction_numerical': 0.0011117287381878821, 'mean_word_length': 4.357142857142857, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '787826', 'n_tokens_mistral': 660, 'n_tokens_neox': 644, 'n_words': 172}