X Tutup
Skip to content
This repository was archived by the owner on Jan 4, 2023. It is now read-only.

Commit d0a911b

Browse files
committed
Fixing issues in the pixel exporter, paint, and workspace tool from renderer refactoring.
1 parent 1b6c30c commit d0a911b

18 files changed

+110
-263
lines changed

Disks/PixelVisionOS/System/Libs/pixel-vision-os-option-modal-v1.lua

Lines changed: 0 additions & 209 deletions
This file was deleted.

Disks/PixelVisionOS/System/Libs/pixel-vision-ui-utils-v2.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ local absindex = function(len, i)
2020
end
2121

2222
string.starts = function(String, Start)
23+
2324
return string.sub(String, 1, string.len(Start)) == Start
2425
end
2526

Disks/PixelVisionOS/System/Tools/PaintTool/Src/canvas-panel.lua

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function PaintTool:CreateCanvasPanel()
2121
self.gridSize = 8
2222
self.snapToGrid = true
2323
self.mousePos = NewPoint()
24-
24+
2525
-- self.scale = 1
2626
self.scaledViewport = NewRect()
2727
self.scaleValues = {.5, 1, 2, 4, 8}--, 8}
@@ -480,8 +480,8 @@ function PaintTool:DrawCanvasPanel()
480480
tmpY + self.viewportRect.Y,
481481
DrawMode.UI,
482482
self.scale,
483-
-1,
484-
-1,
483+
0,
484+
0,
485485
self.brushColorOffset,
486486
self.brushMaskRect
487487
)
@@ -610,7 +610,8 @@ function PaintTool:DrawCanvasPanel()
610610
end
611611

612612
-- Redraw the background of the canvas
613-
self.backgroundLayerCanvas:DrawPixels(self.viewportRect.X, self.viewportRect.Y, DrawMode.TilemapCache, self.scale, -1, self.maskColor, 0, self.scaledViewport)
613+
-- self.backgroundLayerCanvas:Fill(15)
614+
self.backgroundLayerCanvas:DrawPixels(self.viewportRect.X, self.viewportRect.Y, DrawMode.TilemapCache, self.scale, 0, self.maskColor, 0, self.scaledViewport)
614615

615616

616617
-- print("self.mouseState", self.mouseState)
@@ -1311,9 +1312,9 @@ function PaintTool:InvalidateBackground()
13111312
-- Mode 1 will render the transparent canvas texture for the background
13121313
if(self.backgroundMode == 1) then
13131314

1314-
self.backgroundLayerCanvas:SetStroke(-1, 0)
1315-
self.backgroundLayerCanvas:SetPattern(Sprite(MetaSprite("emptymaskcolor").Sprites[1].Id), 8, 8)
1316-
self.backgroundLayerCanvas:DrawRectangle(0, 0, self.backgroundLayerCanvas.Width, self.backgroundLayerCanvas.Height, true)
1315+
-- self.backgroundLayerCanvas:SetStroke(0, 0)
1316+
-- self.backgroundLayerCanvas:SetPattern(Sprite(MetaSprite("emptymaskcolor").Sprites[1].Id), 8, 8)
1317+
-- self.backgroundLayerCanvas:DrawRectangle(0, 0, self.backgroundLayerCanvas.Width, self.backgroundLayerCanvas.Height, true)
13171318

13181319
-- Mode 2 will render the background color
13191320
elseif(self.backgroundMode == 2) then

Disks/PixelVisionOS/System/Tools/PaintTool/Src/import-colors.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ function PaintTool:OnImportColors(path)
147147

148148
local tmpColorIndex, tmpRefIndex = 0, 0
149149

150+
print("colors", dump(colors))
151+
150152
-- Loop through all of the system colors
151153
for i = 1, self.totalColors do
152154

Disks/PixelVisionOS/System/Tools/PaintTool/Src/index-colors.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ function PaintTool:IndexColors()
7070

7171
self:IndexColors()
7272

73+
-- TODO need to look into a better way of doing this since it's hacky
74+
self.colorOffset = self.colorOffset + 1
75+
7376
end
7477

7578
function PaintTool:InvalidateColors()

Disks/PixelVisionOS/System/Tools/PaintTool/Src/paint-tool.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function PaintTool:Init()
4343
invalid = true,
4444
image = nil,
4545
defaultColors = {
46+
"#FF00FF",
4647
"#2D1B2E",
4748
"#218A91",
4849
"#3CC2FA",

0 commit comments

Comments
 (0)
X Tutup