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
68d34a0d
Commit
68d34a0d
authored
Dec 30, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed: rotation adjust code was overwriting scripts;
Fixed: positioning of stretched + rotated text
parent
f13720c6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
16 deletions
+34
-16
src/data/field.cpp
src/data/field.cpp
+17
-14
src/data/field/text.cpp
src/data/field/text.cpp
+1
-0
src/gui/control/text_ctrl.cpp
src/gui/control/text_ctrl.cpp
+2
-1
src/script/scriptable.hpp
src/script/scriptable.hpp
+4
-0
src/util/rotation.cpp
src/util/rotation.cpp
+10
-1
No files found.
src/data/field.cpp
View file @
68d34a0d
...
@@ -127,6 +127,13 @@ template <> StyleP read_new<Style>(Reader&) {
...
@@ -127,6 +127,13 @@ template <> StyleP read_new<Style>(Reader&) {
throw
InternalError
(
_
(
"IndexMap contains nullptr StyleP the application should have crashed already"
));
throw
InternalError
(
_
(
"IndexMap contains nullptr StyleP the application should have crashed already"
));
}
}
inline
bool
is_set
(
const
Scriptable
<
double
>&
x
)
{
return
x
.
isScripted
()
||
x
<
100000
;
}
inline
bool
is_setw
(
const
Scriptable
<
double
>&
x
)
{
return
x
.
isScripted
()
||
abs
(
x
)
>
0.001
;
}
int
Style
::
update
(
Context
&
ctx
)
{
int
Style
::
update
(
Context
&
ctx
)
{
bool
changed
=
bool
changed
=
left
.
update
(
ctx
)
left
.
update
(
ctx
)
...
@@ -139,13 +146,13 @@ int Style::update(Context& ctx) {
...
@@ -139,13 +146,13 @@ int Style::update(Context& ctx) {
|
visible
.
update
(
ctx
);
|
visible
.
update
(
ctx
);
// determine automatic_side and attachment of rotation point
// determine automatic_side and attachment of rotation point
if
(
automatic_side
==
AUTO_UNKNOWN
)
{
if
(
automatic_side
==
AUTO_UNKNOWN
)
{
if
(
right
==
1000000
)
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_RIGHT
);
if
(
!
is_set
(
right
))
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_RIGHT
);
else
if
(
width
==
0
)
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_WIDTH
);
else
if
(
!
is_setw
(
width
))
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_WIDTH
);
else
if
(
left
==
1000000
)
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_LEFT
);
else
if
(
!
is_set
(
left
))
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_LEFT
);
else
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_LR
);
else
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_LR
);
if
(
bottom
==
1000000
)
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_BOTTOM
);
if
(
!
is_set
(
bottom
)
)
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_BOTTOM
);
else
if
(
height
==
0
)
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_HEIGHT
);
else
if
(
!
is_setw
(
height
))
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_HEIGHT
);
else
if
(
top
==
1000000
)
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_TOP
);
else
if
(
!
is_set
(
top
))
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_TOP
);
else
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_TB
);
else
automatic_side
=
(
AutomaticSide
)(
automatic_side
|
AUTO_TB
);
changed
=
true
;
changed
=
true
;
}
}
...
@@ -187,12 +194,8 @@ bool Style::isVisible() const {
...
@@ -187,12 +194,8 @@ bool Style::isVisible() const {
&&
abs
(
bottom
)
<
100000
;
&&
abs
(
bottom
)
<
100000
;
}
}
bool
Style
::
hasSize
()
const
{
bool
Style
::
hasSize
()
const
{
int
h
=
(
abs
(
width
)
>
0
||
width
.
isScripted
())
int
h
=
is_setw
(
width
)
+
is_set
(
left
)
+
is_set
(
right
);
+
(
abs
(
left
)
<
100000
||
left
.
isScripted
())
int
v
=
is_setw
(
height
)
+
is_set
(
top
)
+
is_set
(
bottom
);
+
(
abs
(
right
)
<
100000
||
right
.
isScripted
());
int
v
=
(
abs
(
height
)
>
0
||
height
.
isScripted
())
+
(
abs
(
top
)
<
100000
||
top
.
isScripted
())
+
(
abs
(
bottom
)
<
100000
||
bottom
.
isScripted
());
return
h
>=
2
&&
v
>=
2
;
return
h
>=
2
&&
v
>=
2
;
}
}
...
...
src/data/field/text.cpp
View file @
68d34a0d
...
@@ -53,6 +53,7 @@ TextStyle::TextStyle(const TextFieldP& field)
...
@@ -53,6 +53,7 @@ TextStyle::TextStyle(const TextFieldP& field)
,
line_height_line_max
(
0.0
)
,
line_height_line_max
(
0.0
)
,
paragraph_height
(
-
1
)
,
paragraph_height
(
-
1
)
,
direction
(
LEFT_TO_RIGHT
)
,
direction
(
LEFT_TO_RIGHT
)
,
content_width
(
0
),
content_height
(
0
),
content_lines
(
0
)
{}
{}
double
TextStyle
::
getStretch
()
const
{
double
TextStyle
::
getStretch
()
const
{
...
...
src/gui/control/text_ctrl.cpp
View file @
68d34a0d
...
@@ -86,7 +86,8 @@ void TextCtrl::onChangeSet() {
...
@@ -86,7 +86,8 @@ void TextCtrl::onChangeSet() {
field
->
multi_line
=
multi_line
;
field
->
multi_line
=
multi_line
;
style
->
width
=
100
;
style
->
width
=
100
;
style
->
height
=
20
;
style
->
height
=
20
;
style
->
left
=
style
->
top
=
1
;
style
->
left
=
1
;
style
->
top
=
1
;
style
->
font
.
color
=
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_WINDOWTEXT
);
style
->
font
.
color
=
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_WINDOWTEXT
);
// assign to this control
// assign to this control
IndexMap
<
FieldP
,
StyleP
>
styles
;
styles
.
add
(
field
,
style
);
IndexMap
<
FieldP
,
StyleP
>
styles
;
styles
.
add
(
field
,
style
);
...
...
src/script/scriptable.hpp
View file @
68d34a0d
...
@@ -120,6 +120,10 @@ class Scriptable {
...
@@ -120,6 +120,10 @@ class Scriptable {
inline
operator
const
T
&
()
const
{
return
value
;
}
inline
operator
const
T
&
()
const
{
return
value
;
}
inline
const
T
&
operator
()()
const
{
return
value
;
}
inline
const
T
&
operator
()()
const
{
return
value
;
}
inline
T
&
mutate
()
{
return
value
;
}
inline
T
&
mutate
()
{
return
value
;
}
inline
void
operator
=
(
const
T
&
value
)
{
this
->
value
=
value
;
}
inline
bool
isScripted
()
const
{
return
script
;
}
inline
bool
isScripted
()
const
{
return
script
;
}
/// Has this value been read from a Reader?
/// Has this value been read from a Reader?
inline
bool
hasBeenRead
()
const
{
return
!
script
.
unparsed
.
empty
();
}
inline
bool
hasBeenRead
()
const
{
return
!
script
.
unparsed
.
empty
();
}
...
...
src/util/rotation.cpp
View file @
68d34a0d
...
@@ -203,7 +203,16 @@ void RotatedDC::DrawText (const String& text, const RealPoint& pos, int blur_ra
...
@@ -203,7 +203,16 @@ void RotatedDC::DrawText (const String& text, const RealPoint& pos, int blur_ra
if
(
quality
>=
QUALITY_AA
)
{
if
(
quality
>=
QUALITY_AA
)
{
RealRect
r
(
pos
,
GetTextExtent
(
text
));
RealRect
r
(
pos
,
GetTextExtent
(
text
));
RealRect
r_ext
=
trRectToBB
(
r
);
RealRect
r_ext
=
trRectToBB
(
r
);
draw_resampled_text
(
dc
,
tr
(
pos
),
r_ext
,
stretch_
*
getStretch
(),
angle
,
text
,
blur_radius
,
boldness
);
RealPoint
pos2
=
tr
(
pos
);
if
(
zoomX
!=
zoomY
)
{
r
.
width
*=
zoomX
/
zoomY
;
RealRect
r_ext2
=
trRectToBB
(
r
);
pos2
.
x
+=
r_ext2
.
x
-
r_ext
.
x
;
pos2
.
y
+=
r_ext2
.
y
-
r_ext
.
y
;
r_ext
.
x
=
r_ext2
.
x
;
r_ext
.
y
=
r_ext2
.
y
;
}
draw_resampled_text
(
dc
,
pos2
,
r_ext
,
stretch_
*
getStretch
(),
angle
,
text
,
blur_radius
,
boldness
);
}
else
if
(
quality
>=
QUALITY_SUB_PIXEL
)
{
}
else
if
(
quality
>=
QUALITY_SUB_PIXEL
)
{
RealPoint
p_ext
=
tr
(
pos
)
*
text_scaling
;
RealPoint
p_ext
=
tr
(
pos
)
*
text_scaling
;
double
usx
,
usy
;
double
usx
,
usy
;
...
...
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