To those encountering this problem, add following code somewhere in Image.cpp:
#if WITH_EDITOR
void UImage::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
const FName PropertyName = (PropertyChangedEvent.Property != nullptr) ? PropertyChangedEvent.Property->GetFName() : NAME_None;
if (PropertyName == FName(TEXT("ResourceObject")))
{
if (UTexture2D* TexResource = Cast<UTexture2D>(Brush.GetResourceObject()))
{
Brush.ImageSize.X = TexResource->GetSizeX();
Brush.ImageSize.Y = TexResource->GetSizeY();
}
}
Super::PostEditChangeProperty(PropertyChangedEvent);
}
#endif
And Image.h:
#if WITH_EDITOR
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
#endif
The code is pretty much self-explanatory.