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
348d1b8b
Commit
348d1b8b
authored
Apr 30, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 'angle' property for choice fields
parent
c2060f77
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
12 deletions
+13
-12
src/data/field/choice.cpp
src/data/field/choice.cpp
+2
-0
src/data/field/choice.hpp
src/data/field/choice.hpp
+1
-0
src/gfx/rotate_image.cpp
src/gfx/rotate_image.cpp
+5
-8
src/render/value/choice.cpp
src/render/value/choice.cpp
+2
-1
src/util/rotation.cpp
src/util/rotation.cpp
+2
-2
src/util/rotation.hpp
src/util/rotation.hpp
+1
-1
No files found.
src/data/field/choice.cpp
View file @
348d1b8b
...
...
@@ -165,6 +165,7 @@ ChoiceStyle::ChoiceStyle(const ChoiceFieldP& field)
,
colors_card_list
(
false
)
,
combine
(
COMBINE_NORMAL
)
,
alignment
(
ALIGN_STRETCH
)
,
angle
(
0
)
,
thumbnails
(
nullptr
)
,
thumbnail_age
(
1
)
// thumbnails were made before the beginning of time
,
invalidated_images
(
false
)
...
...
@@ -231,6 +232,7 @@ IMPLEMENT_REFLECTION(ChoiceStyle) {
REFLECT_N
(
"mask"
,
mask_filename
);
REFLECT
(
combine
);
REFLECT
(
alignment
);
REFLECT
(
angle
);
REFLECT
(
colors_card_list
);
REFLECT
(
font
);
REFLECT
(
choice_images
);
...
...
src/data/field/choice.hpp
View file @
348d1b8b
...
...
@@ -131,6 +131,7 @@ class ChoiceStyle : public Style {
ImageCombine
combine
;
///< Combining mode for drawing the images
Alignment
alignment
;
///< Alignment of images
Image
mask
;
///< The actual mask image
int
angle
;
///< Angle by which the images are rotated
wxImageList
*
thumbnails
;
///< Thumbnails for the choices
Age
thumbnail_age
;
///< Age the thumbnails were generated
bool
invalidated_images
;
///< Have the images been invalidated?
...
...
src/gfx/rotate_image.cpp
View file @
348d1b8b
...
...
@@ -83,13 +83,10 @@ struct Rotate270 {
// ----------------------------------------------------------------------------- : Interface
Image
rotate_image
(
const
Image
&
image
,
int
angle
)
{
if
(
angle
==
90
)
{
return
rotate_image_impl
<
Rotate90
>
(
image
);
}
else
if
(
angle
==
180
){
return
rotate_image_impl
<
Rotate180
>
(
image
);
}
else
if
(
angle
==
270
){
return
rotate_image_impl
<
Rotate270
>
(
image
);
}
else
{
return
image
;
switch
(
angle
%
360
)
{
case
90
:
return
rotate_image_impl
<
Rotate90
>
(
image
);
case
180
:
return
rotate_image_impl
<
Rotate180
>
(
image
);
case
270
:
return
rotate_image_impl
<
Rotate270
>
(
image
);
default:
return
image
;
}
}
src/render/value/choice.cpp
View file @
348d1b8b
...
...
@@ -43,7 +43,8 @@ void ChoiceValueViewer::draw(RotatedDC& dc) {
// draw
dc
.
DrawImage
(
i
->
image
,
align_in_rect
(
style
().
alignment
,
RealSize
(
i
->
image
.
GetWidth
(),
i
->
image
.
GetHeight
()),
style
().
getRect
()),
i
->
combine
==
COMBINE_NORMAL
?
style
().
combine
:
i
->
combine
i
->
combine
==
COMBINE_NORMAL
?
style
().
combine
:
i
->
combine
,
style
().
angle
);
margin
=
dc
.
trInvS
(
i
->
image
.
GetWidth
())
+
1
;
}
...
...
src/util/rotation.cpp
View file @
348d1b8b
...
...
@@ -151,8 +151,8 @@ void RotatedDC::DrawBitmap(const Bitmap& bitmap, const RealPoint& pos) {
DrawImage
(
bitmap
.
ConvertToImage
(),
pos
);
}
}
void
RotatedDC
::
DrawImage
(
const
Image
&
image
,
const
RealPoint
&
pos
,
ImageCombine
combine
)
{
Image
rotated
=
rotate_image
(
image
,
angle
);
void
RotatedDC
::
DrawImage
(
const
Image
&
image
,
const
RealPoint
&
pos
,
ImageCombine
combine
,
int
angle
)
{
Image
rotated
=
rotate_image
(
image
,
angle
+
this
->
angle
);
wxRect
r
=
trNoNegNoZoom
(
RealRect
(
pos
,
RealSize
(
image
.
GetWidth
(),
image
.
GetHeight
())));
draw_combine_image
(
dc
,
r
.
x
,
r
.
y
,
rotated
,
combine
);
}
...
...
src/util/rotation.hpp
View file @
348d1b8b
...
...
@@ -142,7 +142,7 @@ class RotatedDC : public Rotation {
/// Draw abitmap, it must already be zoomed!
void
DrawBitmap
(
const
Bitmap
&
bitmap
,
const
RealPoint
&
pos
);
/// Draw an image using the given combining mode, the image must already be zoomed!
void
DrawImage
(
const
Image
&
image
,
const
RealPoint
&
pos
,
ImageCombine
combine
=
COMBINE_NORMAL
);
void
DrawImage
(
const
Image
&
image
,
const
RealPoint
&
pos
,
ImageCombine
combine
=
COMBINE_NORMAL
,
int
angle
=
0
);
void
DrawLine
(
const
RealPoint
&
p1
,
const
RealPoint
&
p2
);
void
DrawRectangle
(
const
RealRect
&
r
);
void
DrawRoundedRectangle
(
const
RealRect
&
r
,
double
radius
);
...
...
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