Skip to content

Commit 6fb9853

Browse files
Use FORMAT_RGH instead of RGF for layer metadata
Fixes #1546
1 parent c337134 commit 6fb9853

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/Classes/Layers/GroupLayer.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func blend_children(frame: Frame, origin := Vector2i.ZERO, apply_effects := true
2323
return image
2424
var textures: Array[Image] = []
2525
_cache_texture_data.clear()
26-
var metadata_image := Image.create(children.size(), 4, false, Image.FORMAT_RGF)
26+
var metadata_image := Image.create(children.size(), 4, false, Image.FORMAT_RGH)
2727
# Corresponding to the index of texture in textures. This is not the layer index
2828
var current_metadata_index := 0
2929
for i in children.size():

src/UI/Canvas/Canvas.gd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ func draw_layers(force_recreate := false) -> void:
178178
# Nx4 texture, where N is the number of layers and the first row are the blend modes,
179179
# the second are the opacities, the third are the origins and the fourth are the
180180
# clipping mask booleans.
181-
layer_metadata_image = Image.create(project.layers.size(), 4, false, Image.FORMAT_RGF)
181+
# We are using RGH because RG8 causes the move tool preview to be imprecise and
182+
# not follow the pixel grid, and because RGF is not supported by all hardware
183+
# see https://github.com/Orama-Interactive/Pixelorama/issues/1546.
184+
layer_metadata_image = Image.create(project.layers.size(), 4, false, Image.FORMAT_RGH)
182185
# Draw current frame layers
183186
for i in project.layers.size():
184187
var layer := project.layers[i]

0 commit comments

Comments
 (0)