Yes, the distance between the toolbars is used when they are both visible (normal mode), the distance between the single toolbar and the edge of the screen is used in painting mode (and when the swatches/sliders bar is hidden) and the total viewport's width is used in fullscreen mode. When zoomed out, an average between the canvas' borders' x coordinates returns the x coordinate of the axis used for mirroring the canvas. I used the distance because it works exactly like the coordinates when the canvas is zoomed out but when the canvas is partially/totally offscreen it's better to use the screen's borders to perform the average, in order for the axis to never be offscreen.