<commit_before>#include "SpritePropertySetting.h"
#include "Sprite.h"

namespace escale9
{

SpritePropertySetting::SpritePropertySetting(ee::EditPanelImpl* stage, const std::shared_ptr<Sprite>& spr)
	: ee::SpritePropertySetting(stage, spr)
{
	m_type = "Scale9Sprite";
}

void SpritePropertySetting::OnPropertyGridChange(const std::string& name, const wxAny& value)
{
	ee::SpritePropertySetting::OnPropertyGridChange(name, value);

	auto spr = std::dynamic_pointer_cast<Sprite>(GetSprite());
	s2::SCALE9_TYPE type = spr->GetScale9().GetType();
	if (name == wxT("Width") && type != s2::S9_3GRID_VERT) {
		sm::vec2 sz = spr->GetScale9().GetSize();
		sz.x = wxANY_AS(value, float);
		spr->Resize(sz.x, sz.y);
	} else if (name == wxT("Height") && type != s2::S9_3GRID_HORI) {
		sm::vec2 sz = spr->GetScale9().GetSize();
		sz.y = wxANY_AS(value, float);
		spr->Resize(sz.x, sz.y);
	}
}

void SpritePropertySetting::UpdateProperties(wxPropertyGrid* pg)
{
	ee::SpritePropertySetting::UpdateProperties(pg);

	auto spr = std::dynamic_pointer_cast<Sprite>(GetSprite());<commit_msg>[CHANGED] refresh after change scale9 size<commit_after>#include "SpritePropertySetting.h"
#include "Sprite.h"

#include <ee/panel_msg.h>

namespace escale9
{

SpritePropertySetting::SpritePropertySetting(ee::EditPanelImpl* stage, const std::shared_ptr<Sprite>& spr)
	: ee::SpritePropertySetting(stage, spr)
{
	m_type = "Scale9Sprite";
}

void SpritePropertySetting::OnPropertyGridChange(const std::string& name, const wxAny& value)
{
	ee::SpritePropertySetting::OnPropertyGridChange(name, value);

	auto spr = std::dynamic_pointer_cast<Sprite>(GetSprite());
	s2::SCALE9_TYPE type = spr->GetScale9().GetType();
	if (name == wxT("Width") && type != s2::S9_3GRID_VERT) {
		sm::vec2 sz = spr->GetScale9().GetSize();
		sz.x = wxANY_AS(value, float);
		spr->Resize(sz.x, sz.y);
		ee::RefreshPanelSJ::Instance()->Refresh();
	} else if (name == wxT("Height") && type != s2::S9_3GRID_HORI) {
		sm::vec2 sz = spr->GetScale9().GetSize();
		sz.y = wxANY_AS(value, float);
		spr->Resize(sz.x, sz.y);
		ee::RefreshPanelSJ::Instance()->Refresh();
	}
}

void SpritePropertySetting::UpdateProperties(wxPropertyGrid* pg)
{
	ee::SpritePropertySetting::UpdateProperties(pg);

	auto spr = std::dynamic_pointer_cast<Sprite>(GetSprite());
{'fraction_non_alphanumeric': 0.17191601049868765, 'fraction_numerical': 0.013560804899387576, 'mean_word_length': 7.081272084805653, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 22, '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': '2645477', 'n_tokens_mistral': 828, 'n_tokens_neox': 838, 'n_words': 136}