Commit 2f31a94a authored by Boudewijn Rempt's avatar Boudewijn Rempt

Fix rectangular grid spacing limits incorrect after resizing canvas

Fix grid spacing being limited to half load-time image size.
Removed setGridDivision which was only used to set the spacing spinbox max on image load.
Changed spacing spinbox max to int max.

Patch by Carl Olsson, thanks!

BUG: 408166
parent d8c6d4ea
......@@ -150,7 +150,9 @@ void GridConfigWidget::setGridConfigImpl(const KisGridConfig &value)
ui->spacingAspectButton->setKeepAspectRatio(m_d->gridConfig.spacingAspectLocked());
ui->chkShowGrid->setChecked(m_d->gridConfig.showGrid());
ui->intHSpacing->setValue(m_d->gridConfig.spacing().x());
ui->intHSpacing->setMaximum(std::numeric_limits<int>::max());
ui->intVSpacing->setValue(m_d->gridConfig.spacing().y());
ui->intVSpacing->setMaximum(std::numeric_limits<int>::max());
ui->intXOffset->setValue(m_d->gridConfig.offset().x());
ui->intYOffset->setValue(m_d->gridConfig.offset().y());
ui->intSubdivision->setValue(m_d->gridConfig.subdivision());
......@@ -199,12 +201,6 @@ KisGuidesConfig GridConfigWidget::guidesConfig() const
return m_d->guidesConfig;
}
void GridConfigWidget::setGridDivision(int w, int h)
{
ui->intHSpacing->setMaximum(w);
ui->intVSpacing->setMaximum(h);
}
KisGridConfig GridConfigWidget::fetchGuiGridConfig() const
{
KisGridConfig config;
......
......@@ -42,8 +42,6 @@ public:
void setGuidesConfig(const KisGuidesConfig &value);
KisGuidesConfig guidesConfig() const;
void setGridDivision(int w, int h);
bool showRulers() const;
void enableIsometricGrid(bool value);
......
......@@ -89,8 +89,6 @@ void GridDockerDock::setCanvas(KoCanvasBase * canvas)
this,
SLOT(slotGuidesConfigUpdateRequested(KisGuidesConfig)));
slotGuidesConfigUpdateRequested(m_canvas->viewManager()->document()->guidesConfig());
QRect rc = m_canvas->image()->bounds();
m_configWidget->setGridDivision(rc.width() / 2, rc.height() / 2);
// isometric grid only available with OpenGL
if (m_canvas->canvasIsOpenGL()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment