Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
4c0d53cb
Commit
4c0d53cb
authored
Aug 05, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Content dependent scripted images of (multiple) choice values are now updated correctly
parent
4adf0c46
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
0 deletions
+20
-0
src/data/field/choice.cpp
src/data/field/choice.cpp
+7
-0
src/data/field/choice.hpp
src/data/field/choice.hpp
+1
-0
src/render/value/choice.cpp
src/render/value/choice.cpp
+6
-0
src/render/value/multiple_choice.cpp
src/render/value/multiple_choice.cpp
+5
-0
src/render/value/multiple_choice.hpp
src/render/value/multiple_choice.hpp
+1
-0
No files found.
src/data/field/choice.cpp
View file @
4c0d53cb
...
@@ -234,6 +234,13 @@ void ChoiceStyle::initDependencies(Context& ctx, const Dependency& dep) const {
...
@@ -234,6 +234,13 @@ void ChoiceStyle::initDependencies(Context& ctx, const Dependency& dep) const {
ci
.
second
.
initDependencies
(
ctx
,
dep
);
ci
.
second
.
initDependencies
(
ctx
,
dep
);
}
}
}
}
void
ChoiceStyle
::
checkContentDependencies
(
Context
&
ctx
,
const
Dependency
&
dep
)
const
{
Style
::
checkContentDependencies
(
ctx
,
dep
);
image
.
initDependencies
(
ctx
,
dep
);
FOR_EACH_CONST
(
ci
,
choice_images
)
{
ci
.
second
.
initDependencies
(
ctx
,
dep
);
}
}
void
ChoiceStyle
::
invalidate
()
{
void
ChoiceStyle
::
invalidate
()
{
// TODO : this is also done in update(), once should be enough
// TODO : this is also done in update(), once should be enough
// Update choice images and thumbnails
// Update choice images and thumbnails
...
...
src/data/field/choice.hpp
View file @
4c0d53cb
...
@@ -162,6 +162,7 @@ class ChoiceStyle : public Style {
...
@@ -162,6 +162,7 @@ class ChoiceStyle : public Style {
virtual
int
update
(
Context
&
);
virtual
int
update
(
Context
&
);
virtual
void
initDependencies
(
Context
&
,
const
Dependency
&
)
const
;
virtual
void
initDependencies
(
Context
&
,
const
Dependency
&
)
const
;
virtual
void
checkContentDependencies
(
Context
&
,
const
Dependency
&
)
const
;
virtual
void
invalidate
();
virtual
void
invalidate
();
};
};
...
...
src/render/value/choice.cpp
View file @
4c0d53cb
...
@@ -59,6 +59,12 @@ void draw_choice_viewer(RotatedDC& dc, ValueViewer& viewer, ChoiceStyle& style,
...
@@ -59,6 +59,12 @@ void draw_choice_viewer(RotatedDC& dc, ValueViewer& viewer, ChoiceStyle& style,
if
(
style
.
render_style
&
RENDER_IMAGE
)
{
if
(
style
.
render_style
&
RENDER_IMAGE
)
{
// draw image
// draw image
CachedScriptableImage
&
img
=
style
.
image
;
CachedScriptableImage
&
img
=
style
.
image
;
if
(
style
.
content_dependent
)
{
// re run script
Context
&
ctx
=
viewer
.
viewer
.
getContext
();
ctx
.
setVariable
(
SCRIPT_VAR_input
,
to_script
(
value
));
img
.
update
(
ctx
);
}
if
(
img
.
isReady
())
{
if
(
img
.
isReady
())
{
GeneratedImage
::
Options
img_options
;
GeneratedImage
::
Options
img_options
;
get_options
(
dc
,
viewer
,
style
,
img_options
);
get_options
(
dc
,
viewer
,
style
,
img_options
);
...
...
src/render/value/multiple_choice.cpp
View file @
4c0d53cb
...
@@ -82,3 +82,8 @@ void MultipleChoiceValueViewer::drawChoice(RotatedDC& dc, RealPoint& pos, const
...
@@ -82,3 +82,8 @@ void MultipleChoiceValueViewer::drawChoice(RotatedDC& dc, RealPoint& pos, const
// next position
// next position
pos
=
move_in_direction
(
style
().
direction
,
pos
,
size
,
style
().
spacing
);
pos
=
move_in_direction
(
style
().
direction
,
pos
,
size
,
style
().
spacing
);
}
}
void
MultipleChoiceValueViewer
::
onStyleChange
(
int
changes
)
{
if
(
changes
&
CHANGE_MASK
)
style
().
image
.
clearCache
();
ValueViewer
::
onStyleChange
(
changes
);
}
src/render/value/multiple_choice.hpp
View file @
4c0d53cb
...
@@ -22,6 +22,7 @@ class MultipleChoiceValueViewer : public ValueViewer {
...
@@ -22,6 +22,7 @@ class MultipleChoiceValueViewer : public ValueViewer {
virtual
bool
prepare
(
RotatedDC
&
dc
);
virtual
bool
prepare
(
RotatedDC
&
dc
);
virtual
void
draw
(
RotatedDC
&
dc
);
virtual
void
draw
(
RotatedDC
&
dc
);
virtual
void
onStyleChange
(
int
);
protected:
protected:
double
item_height
;
///< Height of a single item, or 0 if non uniform
double
item_height
;
///< Height of a single item, or 0 if non uniform
private:
private:
...
...
Write
Preview
Markdown
is supported
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