Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Krita
Commits
1a47ae24
Commit
1a47ae24
authored
Jan 19, 2018
by
Scott Petrovic
Browse files
BUG:389033
Fix pixel grid enabling not keeping in sync between multiple views
parent
757f7557
Changes
6
Hide whitespace changes
Inline
Side-by-side
libs/ui/KisViewManager.cpp
View file @
1a47ae24
...
...
@@ -460,8 +460,6 @@ void KisViewManager::setCurrentView(KisView *view)
doc
->
image
()
->
compositeProgressProxy
()
->
addProxy
(
d
->
persistentImageProgressUpdater
);
d
->
viewConnections
.
addUniqueConnection
(
&
d
->
statusBar
,
SIGNAL
(
sigCancellationRequested
()),
doc
->
image
(),
SLOT
(
requestStrokeCancellation
()));
d
->
viewConnections
.
addUniqueConnection
(
d
->
showPixelGrid
,
SIGNAL
(
toggled
(
bool
)),
canvasController
,
SLOT
(
slotTogglePixelGrid
(
bool
)));
imageView
->
zoomManager
()
->
setShowRulers
(
d
->
showRulersAction
->
isChecked
());
imageView
->
zoomManager
()
->
setRulersTrackMouse
(
d
->
rulersTrackMouseAction
->
isChecked
());
...
...
@@ -727,9 +725,6 @@ void KisViewManager::createActions()
actionCollection
()
->
addAction
(
"settings_active_author"
,
d
->
actionAuthor
);
slotUpdateAuthorProfileActions
();
d
->
showPixelGrid
=
actionManager
()
->
createAction
(
"view_pixel_grid"
);
d
->
showPixelGrid
->
setChecked
(
cfg
.
pixelGridEnabled
());
}
void
KisViewManager
::
setupManagers
()
...
...
libs/ui/canvas/kis_canvas_controller.cpp
View file @
1a47ae24
...
...
@@ -276,22 +276,6 @@ bool KisCanvasController::wrapAroundMode() const
return
kritaCanvas
->
wrapAroundViewingMode
();
}
void
KisCanvasController
::
slotTogglePixelGrid
(
bool
value
)
{
KisConfig
cfg
;
cfg
.
enablePixelGrid
(
value
);
KisCanvas2
*
kritaCanvas
=
dynamic_cast
<
KisCanvas2
*>
(
canvas
());
// pixel grid only works with openGL
if
(
kritaCanvas
->
canvasIsOpenGL
()
)
{
KisOpenGLCanvas2
*
openGLWidget
=
dynamic_cast
<
KisOpenGLCanvas2
*>
(
kritaCanvas
->
canvasWidget
());
openGLWidget
->
slotConfigChanged
();
}
}
void
KisCanvasController
::
slotToggleLevelOfDetailMode
(
bool
value
)
{
KisCanvas2
*
kritaCanvas
=
dynamic_cast
<
KisCanvas2
*>
(
canvas
());
...
...
libs/ui/canvas/kis_canvas_controller.h
View file @
1a47ae24
...
...
@@ -58,7 +58,6 @@ public Q_SLOTS:
qreal
rotation
()
const
;
void
resetCanvasRotation
();
void
slotToggleWrapAroundMode
(
bool
value
);
void
slotTogglePixelGrid
(
bool
value
);
void
slotToggleLevelOfDetailMode
(
bool
value
);
Q_SIGNALS:
...
...
libs/ui/kis_paintop_box.cc
View file @
1a47ae24
...
...
@@ -398,6 +398,11 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
m_toolOptionsPopup
->
switchDetached
(
false
);
}
// pixel grid
m_showPixelGridAction
=
m_viewManager
->
actionManager
()
->
createAction
(
"view_pixel_grid"
);
m_showPixelGridAction
->
setChecked
(
cfg
.
pixelGridEnabled
());
connect
(
m_showPixelGridAction
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
slotEnableShowPixelGrid
(
bool
)));
m_savePresetWidget
=
new
KisPresetSaveWidget
(
this
);
...
...
@@ -740,6 +745,12 @@ void KisPaintopBox::slotSetPaintop(const QString& paintOpId)
}
}
void
KisPaintopBox
::
slotEnableShowPixelGrid
(
bool
enabled
)
{
KisConfig
cfg
;
cfg
.
enablePixelGrid
(
enabled
);
}
void
KisPaintopBox
::
slotInputDeviceChanged
(
const
KoInputDevice
&
inputDevice
)
{
TabletToolMap
::
iterator
toolData
=
m_tabletToolMap
.
find
(
inputDevice
);
...
...
libs/ui/kis_paintop_box.h
View file @
1a47ae24
...
...
@@ -121,6 +121,7 @@ public Q_SLOTS:
void
slotInputDeviceChanged
(
const
KoInputDevice
&
inputDevice
);
void
slotCanvasResourceChanged
(
int
key
,
const
QVariant
&
v
);
void
resourceSelected
(
KoResource
*
resource
);
void
slotEnableShowPixelGrid
(
bool
enabled
);
/// This should take care of creating a new brush preset from scratch
/// It will either load the default brush preset for the engine,
...
...
@@ -205,6 +206,8 @@ private:
KisAction
*
m_eraseAction
;
KisAction
*
m_reloadAction
;
KisAction
*
m_disablePressureAction
;
KisAction
*
m_showPixelGridAction
;
QString
m_currCompositeOpID
;
KisNodeWSP
m_previousNode
;
...
...
libs/ui/opengl/kis_opengl_canvas2.cpp
View file @
1a47ae24
...
...
@@ -107,7 +107,6 @@ public:
#endif
qreal
pixelGridDrawingThreshold
;
bool
pixelGridEnabled
;
QColor
gridColor
;
QColor
cursorColor
;
...
...
@@ -785,7 +784,6 @@ void KisOpenGLCanvas2::slotConfigChanged()
d
->
filterMode
=
(
KisOpenGL
::
FilterMode
)
cfg
.
openGLFilteringMode
();
d
->
pixelGridDrawingThreshold
=
cfg
.
getPixelGridDrawingThreshold
();
d
->
pixelGridEnabled
=
cfg
.
pixelGridEnabled
();
d
->
gridColor
=
cfg
.
getPixelGridColor
();
d
->
cursorColor
=
cfg
.
getCursorMainColor
();
...
...
@@ -825,7 +823,10 @@ void KisOpenGLCanvas2::renderCanvasGL()
drawCheckers
();
drawImage
();
if
((
coordinatesConverter
()
->
effectiveZoom
()
>
d
->
pixelGridDrawingThreshold
-
0.00001
)
&&
d
->
pixelGridEnabled
)
{
KisConfig
cfg
;
if
((
coordinatesConverter
()
->
effectiveZoom
()
>
d
->
pixelGridDrawingThreshold
-
0.00001
)
&&
cfg
.
pixelGridEnabled
())
{
drawGrid
();
}
if
(
KisOpenGL
::
hasOpenGL3
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment