Skip to content

Commit

Permalink
Fix the decal with a wrong rotation (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
spimort authored Sep 18, 2024
1 parent 5992e5d commit 4f411f7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions addons/terrabrush/Scripts/BrushDecal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public void SetSize(int size) {
public void SetBrushImage(Image image) {
var imageCopy = new Image();
imageCopy.CopyFrom(image);
imageCopy.FlipY();
imageCopy.FlipX();

for (var x = 0; x < imageCopy.GetWidth(); x++) {
for (var y = 0; y < imageCopy.GetHeight(); y++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ [Export] public Texture2D AlbedoTexture {
get {
return _albedoTexture;
} set {
if (value != null && value.ResourcePath != _albedoTexture?.ResourcePath) {
if (value != null && !string.IsNullOrWhiteSpace(value.ResourcePath) && value.ResourcePath != _albedoTexture?.ResourcePath) {
var directory = value.ResourcePath.Replace(System.IO.Path.GetFileName(value.ResourcePath), "");
var directoryFiles = DirAccess.GetFilesAt(directory);

Expand Down
2 changes: 0 additions & 2 deletions addons/terrabrush/Scripts/TerrainControlDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ private void UpdateSelectedBrush() {
}

var brushImage = ((DockPreviewButton) brushesPreview[_selectedBrushIndex]).ButtonImage.GetImage();
brushImage.FlipY();
brushImage.FlipX();
TerraBrush?.SetCurrentBrush(_selectedBrushIndex, brushImage);
BrushDecal?.SetBrushImage(brushImage);
}
Expand Down
2 changes: 1 addition & 1 deletion addons/terrabrush/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="TerraBrush"
description=""
author="spimort"
version="0.8.3-alpha"
version="0.8.4-alpha"
script="Plugin.cs"

0 comments on commit 4f411f7

Please sign in to comment.