Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/application/Application.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ export default class Application extends Component {
// Multiple events.
for (let i = 0; i < n; i++) {
const target = path[i];
const events = isHorizontalDirection && target.rtl ? eventsRtl : eventsLtr;
const event = target._getMostSpecificHandledMember(events);
const targetEvents = isHorizontalDirection && target.rtl ? eventsRtl : eventsLtr;
const event = target._getMostSpecificHandledMember(targetEvents);
if (event !== undefined) {
const returnValue = target[event](...args);
if (returnValue !== false) {
Expand Down
2 changes: 1 addition & 1 deletion src/textures/TextTokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class TextTokenizer {
// - first, matching all characters between space (32) and ~ (127)
// - second, matching all unicode quotation marks (see https://hexdocs.pm/ex_unicode/Unicode.Category.QuoteMarks.html)
// - third, matching the unicode en/em dashes (see https://en.wikipedia.org/wiki/Dash#Unicode)
return text.charAt(0) <= 'z' && !/[^ -~'-›–—]/.test(text);
return text.charAt(0) <= 'z' && !/[^ -~\u2018-\u201F\u2039\u203A\u2013\u2014]/.test(text);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/textures/bidiTokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Direction = 'lri' | 'rli' | 'fsi' | 'default';

// https://www.unicode.org/reports/tr9/
const reZeroWidthSpace = /[\u200B\u200E\u200F\u061C]/;
const reDirectionalFormat = /[\u202A\u202B\u202C\u202D\u202E\u202E\u2066\u2067\u2068\u2069]/;
const reDirectionalFormat = /[\u202A\u202B\u202C\u202D\u202E\u2066\u2067\u2068\u2069]/;

const LRI = '\u2066'; // Left-to-Right Isolate ('ltr')
const RLI = '\u2067'; // Right-to-Left Isolate ('rtl')
Expand Down
4 changes: 0 additions & 4 deletions tests/textures/test.text.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ describe('text', function() {
app.children = [element];
const texture = app.tag("Item").texture;
stage.drawFrame();
console.log(texture.source.renderInfo.lines);
chai.assert(texture.source.renderInfo.lines.length === 3);
chai.assert(getLineText(texture.source.renderInfo.lines[0]) === 'EXTRA-LONG-WORD');
});
Expand All @@ -330,7 +329,6 @@ describe('text', function() {
app.children = [element];
const texture = app.tag("Item").texture;
stage.drawFrame();
console.log(texture.source.renderInfo.lines);
chai.assert(texture.source.renderInfo.lines.length === 4);
chai.assert(getLineText(texture.source.renderInfo.lines[0]) === 'Sit');
chai.assert(getLineText(texture.source.renderInfo.lines[1]) === 'EXTRA-LONG-WORD');
Expand All @@ -351,7 +349,6 @@ describe('text', function() {
app.children = [element];
const texture = app.tag("Item").texture;
stage.drawFrame();
console.log(texture.source.renderInfo.lines);
chai.assert(texture.source.renderInfo.lines.length === 9);
chai.assert(getLineText(texture.source.renderInfo.lines[0]) === 'EXTR');
chai.assert(getLineText(texture.source.renderInfo.lines[1]) === 'A-LO');
Expand All @@ -374,7 +371,6 @@ describe('text', function() {
app.children = [element];
const texture = app.tag("Item").texture;
stage.drawFrame();
console.log(texture.source.renderInfo.lines);
chai.assert(texture.source.renderInfo.lines.length === 10);
chai.assert(getLineText(texture.source.renderInfo.lines[0]) === 'Sit');
chai.assert(getLineText(texture.source.renderInfo.lines[1]) === 'EXTR');
Expand Down