gerbview: XOR mode is not working correctly

Description

As already described in ticket xxx, the XOR mode in gerbview is still not working properly.

Differential mode

Everything looks fine in differentiated mode

Layer 1 active

gerbview_diff_mode_layer_1

Layer 2 active

gerbview_diff_mode_layer_2

XOR mode

In XOR mode there are display errors if a layer with a smaller number is displayed than the layer with the difference.

Layer 1 active (With error, here I would expect the contour from layer 2, but in green color)

gerbview_xor_mode_layer_1

Layer 2 active

gerbview_xor_mode_layer_2

This topic #17282 (closed) has already been discussed here, but I see that there is no final solution.

Steps to reproduce

  1. Open gerbview
  2. Load the first layer (Number 1)
  3. Load the 2nd layer (Number 2) with a small change to the 1st layer
  4. Enable the XOR mode
  5. Enable the visibility from the first layer

KiCad Version


Version: 8.0.5, release build

Libraries:
	wxWidgets 3.2.5
	FreeType 2.13.2
	HarfBuzz 9.0.0
	FontConfig 2.14.2
	libcurl/8.8.0-DEV Schannel zlib/1.3.1

Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW
OpenGL: NVIDIA Corporation, NVIDIA GeForce GTX 1650/PCIe/SSE2, 4.6.0 NVIDIA 561.09

Build Info:
	Date: Sep  7 2024 02:39:48
	wxWidgets: 3.2.5 (wchar_t,wx containers)
	Boost: 1.85.0
	OCC: 7.8.1
	Curl: 8.8.0-DEV
	ngspice: 42
	Compiler: Visual C++ 1939 without C++ ABI

Build settings:
Edited by Jan Wichmann