Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 6f82bf3

Browse files
[[ Bug 12075 ]] Fixes the issue of text order in labels and tooltip
Refactors as well the unicode.cpp functions - now in foundation-unicode
1 parent faf7f10 commit 6f82bf3

31 files changed

+2089
-1843
lines changed

engine/engine.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
4D1F9D8E171C682E0091C6CB /* transfer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D61BD9D0CCF74C800D74FDB /* transfer.cpp */; };
162162
4D1F9D8F171C682E0091C6CB /* uidc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D587E8A0B8096FD00200116 /* uidc.cpp */; };
163163
4D1F9D90171C682E0091C6CB /* undolst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D587E5F0B8096FD00200116 /* undolst.cpp */; };
164-
4D1F9D91171C682E0091C6CB /* unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DD27ACB0D5B3A280000CC15 /* unicode.cpp */; };
165164
4D1F9D92171C682E0091C6CB /* util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D587E8D0B8096FD00200116 /* util.cpp */; };
166165
4D1F9D93171C682E0091C6CB /* variable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D587E600B8096FD00200116 /* variable.cpp */; };
167166
4D1F9D96171C682E0091C6CB /* vclip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D587E620B8096FD00200116 /* vclip.cpp */; };
@@ -484,7 +483,6 @@
484483
4DEE2B070FDE42710009423C /* transfer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D61BD9D0CCF74C800D74FDB /* transfer.cpp */; };
485484
4DEE2B080FDE42710009423C /* uidc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D587E8A0B8096FD00200116 /* uidc.cpp */; };
486485
4DEE2B0A0FDE42710009423C /* undolst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D587E5F0B8096FD00200116 /* undolst.cpp */; };
487-
4DEE2B0B0FDE42710009423C /* unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DD27ACB0D5B3A280000CC15 /* unicode.cpp */; };
488486
4DEE2B0C0FDE42710009423C /* util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D587E8D0B8096FD00200116 /* util.cpp */; };
489487
4DEE2B0D0FDE42710009423C /* variable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D587E600B8096FD00200116 /* variable.cpp */; };
490488
4DEE2B0F0FDE42710009423C /* vclip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D587E620B8096FD00200116 /* vclip.cpp */; };
@@ -1366,8 +1364,6 @@
13661364
4DD27A8A0D5B36E70000CC15 /* rtfsupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rtfsupport.cpp; path = src/rtfsupport.cpp; sourceTree = "<group>"; };
13671365
4DD27ABE0D5B39C20000CC15 /* text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = text.cpp; path = src/text.cpp; sourceTree = "<group>"; };
13681366
4DD27ABF0D5B39C20000CC15 /* text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = text.h; path = src/text.h; sourceTree = "<group>"; };
1369-
4DD27ACB0D5B3A280000CC15 /* unicode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = unicode.cpp; path = src/unicode.cpp; sourceTree = "<group>"; };
1370-
4DD27ACC0D5B3A280000CC15 /* unicode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = unicode.h; path = src/unicode.h; sourceTree = "<group>"; };
13711367
4DD54D18134F591500981610 /* AccelerationChangeListener.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = AccelerationChangeListener.java; sourceTree = "<group>"; };
13721368
4DD54D19134F591500981610 /* CameraCompat.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = CameraCompat.java; sourceTree = "<group>"; };
13731369
4DD54D1A134F591500981610 /* Email.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = Email.java; sourceTree = "<group>"; };
@@ -2885,8 +2881,6 @@
28852881
4D61BDAD0CCF74EF00D74FDB /* transfer.h */,
28862882
4D587E8A0B8096FD00200116 /* uidc.cpp */,
28872883
4D587DDA0B8096E600200116 /* uidc.h */,
2888-
4DD27ACB0D5B3A280000CC15 /* unicode.cpp */,
2889-
4DD27ACC0D5B3A280000CC15 /* unicode.h */,
28902884
4D587E8D0B8096FD00200116 /* util.cpp */,
28912885
4D587E1D0B8096E600200116 /* util.h */,
28922886
4D8589AA173A856600B20951 /* uuid.cpp */,
@@ -3581,7 +3575,6 @@
35813575
4D1F9D8E171C682E0091C6CB /* transfer.cpp in Sources */,
35823576
4D1F9D8F171C682E0091C6CB /* uidc.cpp in Sources */,
35833577
4D1F9D90171C682E0091C6CB /* undolst.cpp in Sources */,
3584-
4D1F9D91171C682E0091C6CB /* unicode.cpp in Sources */,
35853578
4D1F9D92171C682E0091C6CB /* util.cpp in Sources */,
35863579
4D1F9D93171C682E0091C6CB /* variable.cpp in Sources */,
35873580
4D1F9D96171C682E0091C6CB /* vclip.cpp in Sources */,
@@ -3796,7 +3789,6 @@
37963789
4DEE2B070FDE42710009423C /* transfer.cpp in Sources */,
37973790
4DEE2B080FDE42710009423C /* uidc.cpp in Sources */,
37983791
4DEE2B0A0FDE42710009423C /* undolst.cpp in Sources */,
3799-
4DEE2B0B0FDE42710009423C /* unicode.cpp in Sources */,
38003792
4DEE2B0C0FDE42710009423C /* util.cpp in Sources */,
38013793
4DEE2B0D0FDE42710009423C /* variable.cpp in Sources */,
38023794
4DEE2B0F0FDE42710009423C /* vclip.cpp in Sources */,

engine/src/block.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ void MCBlock::drawstring(MCDC *dc, int2 x, int2 cx, int2 y, findex_t start, find
10031003

10041004
t_cell_clip = MCU_intersect_rect(t_cell_clip, t_old_clip);
10051005
dc -> setclip(t_cell_clip);
1006-
dc -> drawtext_substring(x, y, parent->GetInternalStringRef(), t_range, m_font, image == True, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR);
1006+
dc -> drawtext_substring(x, y, parent->GetInternalStringRef(), t_range, m_font, image == True, kMCDrawTextBreak, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR);
10071007

10081008
// Only draw the various boxes/lines if there is any content.
10091009
if (t_next_index - t_index > 0)
@@ -1078,7 +1078,7 @@ void MCBlock::drawstring(MCDC *dc, int2 x, int2 cx, int2 y, findex_t start, find
10781078
twidth = MCFontMeasureTextSubstring(m_font, parent->GetInternalStringRef(), t_range);
10791079
twidth += gettabwidth(cx + twidth, eptr);
10801080

1081-
dc -> drawtext_substring(x, y, parent->GetInternalStringRef(), t_range, m_font, image == True, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR);
1081+
dc -> drawtext_substring(x, y, parent->GetInternalStringRef(), t_range, m_font, image == True, kMCDrawTextBreak, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR);
10821082

10831083
cx += twidth;
10841084
x += twidth;
@@ -1100,7 +1100,7 @@ void MCBlock::drawstring(MCDC *dc, int2 x, int2 cx, int2 y, findex_t start, find
11001100

11011101
MCRange t_range;
11021102
t_range = MCRangeMake(sptr, size);
1103-
dc -> drawtext_substring(x, y, parent->GetInternalStringRef(), t_range, m_font, image == True, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR);
1103+
dc -> drawtext_substring(x, y, parent->GetInternalStringRef(), t_range, m_font, image == True, kMCDrawTextBreak, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR);
11041104

11051105
// Apply strike/underline.
11061106
if ((style & FA_UNDERLINE) != 0)

engine/src/buttondraw.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
502502
if (labelwidth != 0 && !isunnamed())
503503
{
504504
MCStringRef t_name = MCNameGetString(getname());
505-
dc -> drawtext(rect.x + leftmargin, starty, t_name, m_font, false, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR, kMCDrawTextNoBreak);
505+
drawdirectionaltext(dc, rect.x + leftmargin, starty, t_name, m_font);
506506
}
507507

508508
// MW-2012-01-27: [[ Bug 9432 ]] Native GTK handles focus borders itself
@@ -588,15 +588,15 @@ void MCButton::drawlabel(MCDC *dc, int2 sx, int sy, uint2 twidth, const MCRectan
588588
&& menumode == WM_OPTION))
589589
sy--;
590590

591-
dc -> drawtext(sx, sy, p_label, m_font, false, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR, kMCDrawTextNoBreak);
591+
drawdirectionaltext(dc, sx, sy, p_label, m_font);
592592

593593
if (!MCStringIsEmpty(acceltext))
594594
{
595595
uint2 awidth = MCFontMeasureText(m_font, acceltext);
596596
if (rightmargin == defaultmargin || menucontrol == MENUCONTROL_ITEM)
597-
dc -> drawtext(srect.x + srect.width - rightmargin - awidth, sy, acceltext, m_font, false, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR, kMCDrawTextNoBreak);
597+
drawdirectionaltext(dc, srect.x + srect.width - rightmargin - awidth, sy, acceltext, m_font);
598598
else
599-
dc -> drawtext(srect.x + srect.width - rightmargin, sy, acceltext, m_font, false, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR, kMCDrawTextNoBreak);
599+
drawdirectionaltext(dc, srect.x + srect.width - rightmargin, sy, acceltext, m_font);
600600
}
601601

602602
if (fstyle & FA_UNDERLINE)
@@ -1503,7 +1503,7 @@ void MCButton::drawtabs(MCDC *dc, MCRectangle &srect)
15031503
break;
15041504
default:
15051505
setforeground(dc, DI_TOP, False);
1506-
dc -> drawtext(textx, cury + yoffset + 1, t_tab, m_font, false, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR, kMCDrawTextNoBreak);
1506+
dc -> drawtext(textx, cury + yoffset + 1, t_tab, m_font, false, kMCDrawTextNoBreak);
15071507
setforeground(dc, DI_BOTTOM, False);
15081508
break;
15091509
}
@@ -1514,7 +1514,7 @@ void MCButton::drawtabs(MCDC *dc, MCRectangle &srect)
15141514
else
15151515
setforeground(dc, DI_FORE, False);
15161516

1517-
dc -> drawtext(textx, cury + yoffset, t_tab, m_font, false, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR, kMCDrawTextNoBreak);
1517+
dc -> drawtext(textx, cury + yoffset, t_tab, m_font, false, kMCDrawTextNoBreak);
15181518
if ((disabled || flags & F_DISABLED) && MClook == LF_MOTIF)
15191519
dc->setfillstyle(FillSolid, nil, 0 , 0);
15201520
curx += twidth;

engine/src/context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ class MCContext
170170
virtual void drawline(int2 x1, int2 y1, int2 x2, int2 y2) = 0;
171171
virtual void drawlines(MCPoint *points, uint2 npoints, bool p_closed = false) = 0;
172172
virtual void drawsegments(MCSegment *segments, uint2 nsegs) = 0;
173-
virtual void drawtext(int2 x, int2 y, MCStringRef p_string, MCFontRef p_font, Boolean image, MCDrawTextDirection = kMCDrawTextDirectionLTR, MCDrawTextBreaking = kMCDrawTextBreak) = 0;
174-
virtual void drawtext_substring(int2 x, int2 y, MCStringRef p_string, MCRange p_range, MCFontRef p_font, Boolean image, MCDrawTextDirection = kMCDrawTextDirectionLTR, MCDrawTextBreaking = kMCDrawTextBreak) = 0;
173+
virtual void drawtext(int2 x, int2 y, MCStringRef p_string, MCFontRef p_font, Boolean image, MCDrawTextBreaking = kMCDrawTextBreak, MCDrawTextDirection = kMCDrawTextDirectionLTR) = 0;
174+
virtual void drawtext_substring(int2 x, int2 y, MCStringRef p_string, MCRange p_range, MCFontRef p_font, Boolean image, MCDrawTextBreaking = kMCDrawTextBreak, MCDrawTextDirection = kMCDrawTextDirectionLTR) = 0;
175175
virtual void drawrect(const MCRectangle& rect, bool inside = false) = 0;
176176
virtual void fillrect(const MCRectangle& rect, bool inside = false) = 0;
177177
virtual void fillrects(MCRectangle *rects, uint2 nrects) = 0;

engine/src/exec-interface-field.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ static MCExecEnumTypeElementInfo _kMCInterfaceFieldCursorMovementElementInfo[] =
7373
{ "logical", kMCFieldCursorMovementLogical, false },
7474
};
7575

76-
static MCExecEnumTypeElementInfo _kMCInterfaceFieldTextDirectionElementInfo[] =
76+
static MCExecEnumTypeElementInfo _kMCInterfaceTextDirectionElementInfo[] =
7777
{
78-
{ "auto", kMCFieldTextDirectionAuto, false },
79-
{ "rtl", kMCFieldTextDirectionRTL, false },
80-
{ "ltr", kMCFieldTextDirectionLTR, false },
78+
{ "auto", kMCTextDirectionAuto, false },
79+
{ "rtl", kMCTextDirectionRTL, false },
80+
{ "ltr", kMCTextDirectionLTR, false },
8181
};
8282

8383
static MCExecEnumTypeInfo _kMCInterfaceFieldStyleTypeInfo =
@@ -94,11 +94,11 @@ static MCExecEnumTypeInfo _kMCInterfaceFieldCursorMovementTypeInfo =
9494
_kMCInterfaceFieldCursorMovementElementInfo
9595
};
9696

97-
static MCExecEnumTypeInfo _kMCInterfaceFieldTextDirectionTypeInfo =
97+
static MCExecEnumTypeInfo _kMCInterfaceTextDirectionTypeInfo =
9898
{
9999
"Interface.TextDirection",
100-
sizeof(_kMCInterfaceFieldTextDirectionElementInfo) / sizeof(MCExecEnumTypeElementInfo),
101-
_kMCInterfaceFieldTextDirectionElementInfo
100+
sizeof(_kMCInterfaceTextDirectionElementInfo) / sizeof(MCExecEnumTypeElementInfo),
101+
_kMCInterfaceTextDirectionElementInfo
102102
};
103103

104104
//////////
@@ -220,7 +220,7 @@ static MCExecEnumTypeInfo _kMCInterfaceLayerModeTypeInfo =
220220
MCExecEnumTypeInfo *kMCInterfaceFieldStyleTypeInfo = &_kMCInterfaceFieldStyleTypeInfo;
221221
MCExecCustomTypeInfo *kMCInterfaceFlaggedRangesTypeInfo = &_kMCInterfaceFlaggedRangesTypeInfo;
222222
MCExecEnumTypeInfo *kMCInterfaceFieldCursorMovementTypeInfo = &_kMCInterfaceFieldCursorMovementTypeInfo;
223-
MCExecEnumTypeInfo *kMCInterfaceFieldTextDirectionTypeInfo = &_kMCInterfaceFieldTextDirectionTypeInfo;
223+
MCExecEnumTypeInfo *kMCInterfaceTextDirectionTypeInfo = &_kMCInterfaceTextDirectionTypeInfo;
224224

225225
////////////////////////////////////////////////////////////////////////////////
226226

@@ -902,7 +902,7 @@ void MCField::GetEncoding(MCExecContext& ctxt, uint32_t part, intenum_t& r_encod
902902
pgptr -> GetEncoding(ctxt, t_encoding);
903903
pgptr = pgptr -> next();
904904

905-
while (pgptr != paragraphs);
905+
while (pgptr != paragraphs)
906906
{
907907
pgptr -> GetEncoding(ctxt, t_next);
908908
if (t_next != t_encoding)
@@ -927,7 +927,7 @@ void MCField::GetCursorMovement(MCExecContext& ctxt, intenum_t &r_movement)
927927

928928
void MCField::SetTextDirection(MCExecContext& ctxt, intenum_t p_direction)
929929
{
930-
text_direction = (MCFieldTextDirection)p_direction;
930+
text_direction = (MCTextDirection)p_direction;
931931
}
932932

933933
void MCField::GetTextDirection(MCExecContext& ctxt, intenum_t &r_direction)

engine/src/exec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3360,7 +3360,7 @@ extern MCExecSetTypeInfo *kMCInterfaceButtonAcceleratorModifiersTypeInfo;
33603360
extern MCExecEnumTypeInfo *kMCInterfaceFieldStyleTypeInfo;
33613361
extern MCExecCustomTypeInfo *kMCInterfaceFlaggedRangesTypeInfo;
33623362
extern MCExecEnumTypeInfo *kMCInterfaceFieldCursorMovementTypeInfo;
3363-
extern MCExecEnumTypeInfo *kMCInterfaceFieldTextDirectionTypeInfo;
3363+
extern MCExecEnumTypeInfo *kMCInterfaceTextDirectionTypeInfo;
33643364

33653365
///////////
33663366

engine/src/field.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ MCPropertyInfo MCField::kProperties[] =
102102
DEFINE_RW_OBJ_PROPERTY(P_MULTIPLE_HILITES, Bool, MCField, MultipleHilites)
103103
DEFINE_RW_OBJ_PROPERTY(P_NONCONTIGUOUS_HILITES, Bool, MCField, NoncontiguousHilites)
104104
DEFINE_RW_OBJ_ENUM_PROPERTY(P_CURSORMOVEMENT, InterfaceFieldCursorMovement, MCField, CursorMovement)
105-
DEFINE_RW_OBJ_ENUM_PROPERTY(P_TEXTDIRECTION, InterfaceFieldTextDirection, MCField, TextDirection)
105+
DEFINE_RW_OBJ_ENUM_PROPERTY(P_TEXTDIRECTION, InterfaceTextDirection, MCField, TextDirection)
106106
DEFINE_RW_OBJ_PART_PROPERTY(P_TEXT, String, MCField, Text)
107107
DEFINE_RW_OBJ_PART_PROPERTY(P_UNICODE_TEXT, BinaryString, MCField, UnicodeText)
108108
DEFINE_RW_OBJ_PART_NON_EFFECTIVE_PROPERTY(P_HTML_TEXT, Any, MCField, HtmlText)
@@ -237,7 +237,7 @@ MCField::MCField()
237237
tabs = NULL;
238238
ntabs = 0;
239239
cursor_movement = kMCFieldCursorMovementDefault;
240-
text_direction = kMCFieldTextDirectionAuto;
240+
text_direction = kMCTextDirectionAuto;
241241
label = MCValueRetain(kMCEmptyString);
242242
}
243243

engine/src/field.h

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -173,29 +173,6 @@ typedef bool (*MCFieldExportCallback)(void *context, MCFieldExportEventType even
173173
struct MCInterfaceFlaggedRanges;
174174
struct MCInterfaceFlaggedRange;
175175

176-
// The values assigned to these constants are significant: they represent the
177-
// starting values in the Unicode BiDi algorithm and should not be changed.
178-
enum MCFieldTextDirection
179-
{
180-
kMCFieldTextDirectionAuto = -1, // Detect based on contents
181-
kMCFieldTextDirectionLTR = 0, // Force left-to-right direction
182-
kMCFieldTextDirectionRTL = 1, // Force right-to-left direction
183-
};
184-
185-
// Significant characters for BiDi processing
186-
#define kMCBidiLRE 0x202A // Left-to-right embedding
187-
#define kMCBidiRLE 0x202B // Right-to-left embedding
188-
#define kMCBidiLRO 0x202D // Left-to-right override
189-
#define kMCBidiRLO 0x202E // Right-to-left override
190-
#define kMCBidiPDF 0x202C // Pop directional formatting
191-
#define kMCBidiLRI 0x2066 // Left-to-right isolate
192-
#define kMCBidiRLI 0x2067 // Right-to-left isolate
193-
#define kMCBidiFSI 0x2068 // First strong isolate
194-
#define kMCBidiPDI 0x2069 // Pop directional isolate
195-
#define kMCBidiLRM 0x200E // Left-to-right mark
196-
#define kMCBidiRLM 0x200F // Right-to-left mark
197-
#define kMCBidiALM 0x061C // Arabic letter mark
198-
199176
////////////////////////////////////////////////////////////////////////////////
200177

201178
class MCField : public MCControl
@@ -229,7 +206,7 @@ class MCField : public MCControl
229206
MCScrollbar *vscrollbar;
230207
MCScrollbar *hscrollbar;
231208
MCStringRef label;
232-
MCFieldTextDirection text_direction;
209+
MCTextDirection text_direction;
233210
MCInterfaceFieldCursorMovement cursor_movement;
234211

235212
static int2 clickx;
@@ -364,7 +341,7 @@ class MCField : public MCControl
364341
int32_t getfirstindent(void) const;
365342
int32_t getfixedheight(void) const { return fixedheight; }
366343

367-
MCFieldTextDirection gettextdirection() const { return text_direction; }
344+
MCTextDirection gettextdirection() const { return text_direction; }
368345

369346
bool getshowlines(void) const;
370347

@@ -650,7 +627,7 @@ class MCField : public MCControl
650627

651628
////////// BIDIRECTIONAL SUPPORT
652629

653-
MCFieldTextDirection getbasetextdirection() { return text_direction; }
630+
MCTextDirection getbasetextdirection() { return text_direction; }
654631
bool IsCursorMovementVisual();
655632

656633
////////// PROPERTY SUPPORT METHODS

engine/src/graphic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ MCStringRef MCGraphic::getlabeltext()
17861786

17871787
void MCGraphic::drawlabel(MCDC *dc, int2 sx, int sy, uint2 twidth, const MCRectangle &srect, const MCStringRef &s, uint2 fstyle)
17881788
{
1789-
dc -> drawtext(sx, sy, s, m_font, false, is_rtl() ? kMCDrawTextDirectionRTL : kMCDrawTextDirectionLTR, kMCDrawTextNoBreak);
1789+
drawdirectionaltext(dc, sx, sy, s, m_font);
17901790
if (fstyle & FA_UNDERLINE)
17911791
dc->drawline(sx, sy + 1, sx + twidth, sy + 1);
17921792
if (fstyle & FA_STRIKEOUT)

engine/src/graphicscontext.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,14 +1233,14 @@ void MCGraphicsContext::drawlink(MCStringRef link, const MCRectangle& region)
12331233
}
12341234

12351235

1236-
void MCGraphicsContext::drawtext(int2 x, int2 y, MCStringRef p_string, MCFontRef p_font, Boolean image, MCDrawTextDirection p_direction, MCDrawTextBreaking p_breaking)
1236+
void MCGraphicsContext::drawtext(int2 x, int2 y, MCStringRef p_string, MCFontRef p_font, Boolean image, MCDrawTextBreaking p_breaking, MCDrawTextDirection p_direction)
12371237
{
12381238
MCRange t_range;
12391239
t_range = MCRangeMake(0, MCStringGetLength(p_string));
1240-
drawtext_substring(x, y, p_string, t_range, p_font, image, p_direction, p_breaking);
1240+
drawtext_substring(x, y, p_string, t_range, p_font, image, p_breaking, p_direction);
12411241
}
12421242

1243-
void MCGraphicsContext::drawtext_substring(int2 x, int2 y, MCStringRef p_string, MCRange p_range, MCFontRef p_font, Boolean p_image, MCDrawTextDirection p_direction, MCDrawTextBreaking p_break)
1243+
void MCGraphicsContext::drawtext_substring(int2 x, int2 y, MCStringRef p_string, MCRange p_range, MCFontRef p_font, Boolean p_image, MCDrawTextBreaking p_break, MCDrawTextDirection p_direction)
12441244
{
12451245
// MW-2013-10-29: [[ Bug 11338 ]] If 'image' is true, then render the background
12461246
// rect.

0 commit comments

Comments
 (0)