Skip to content

Commit

Permalink
- The section number 1 is no longer displayed
Browse files Browse the repository at this point in the history
- Fix debug log spam
  • Loading branch information
yezhiyi9670 committed Nov 13, 2024
1 parent 9931016 commit 58fed3f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sparks-notation/core",
"version": "1.15.1",
"version": "1.15.2",
"description": "A natural text format for composing numbered music notation or guitar tabulate scores, formerly known as Sparks NMN.",
"main": "index.js",
"author": "yezhiyi9670 <[email protected]>",
Expand Down
28 changes: 15 additions & 13 deletions packages/core/renderer/article/line/SectionsRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,22 @@ export class SectionsRenderer {
}

// ===== 小节序号 =====
const ordinalMode = context.render!.sectionorder
if(isFirstPart && !hasJumperOverlap && ordinalMode != 'none' && sections.length > 0) {
let ordinalText = (sectionCount + 1).toString()
if(ordinalMode == 'paren') {
ordinalText = '(' + ordinalText + ')'
}
if(ordinalMode == 'bracket') {
ordinalText = '[' + ordinalText + ']'
if(sectionCount > 0) {
const ordinalMode = context.render!.sectionorder
if(isFirstPart && !hasJumperOverlap && ordinalMode != 'none' && sections.length > 0) {
let ordinalText = (sectionCount + 1).toString()
if(ordinalMode == 'paren') {
ordinalText = '(' + ordinalText + ')'
}
if(ordinalMode == 'bracket') {
ordinalText = '[' + ordinalText + ']'
}
const ordinalX = this.columns.paddedStartPosition(0) - 0.5 * scale
const ordinalMetric = new FontMetric(context.render.font_sectionorder!, 1.8)
root.drawText(ordinalX, currY - 3.5, ordinalText, ordinalMetric, scale, 'right', 'bottom', {
fontStyle: ordinalMode == 'plain' ? 'italic' : 'normal'
})
}
const ordinalX = this.columns.paddedStartPosition(0) - 0.5 * scale
const ordinalMetric = new FontMetric(context.render.font_sectionorder!, 1.8)
root.drawText(ordinalX, currY - 3.5, ordinalText, ordinalMetric, scale, 'right', 'bottom', {
fontStyle: ordinalMode == 'plain' ? 'italic' : 'normal'
})
}

const noteMeasure = msp.measureNoteChar(context, isSmall, scale)
Expand Down
1 change: 0 additions & 1 deletion packages/core/renderer/backend/DomPaint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function escapeXml(unsafe: string) {
// 生成 style 字符串
function translateStyles(styles: ExtraStyles) {
return escapeXml(iterateMap(styles, (value, key) => {
console.log(value, key)
return `${camelCase2Hyphen(key)}:${escapeXml(value.toString())};`
}).join(''))
}
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sparks-notation/desktop",
"version": "1.15.1",
"version": "1.15.2",
"description": "A natural text format for composing numbered music notation or guitar tabulate scores, formerly known as Sparks NMN.",
"author": "yezhiyi9670 <[email protected]>",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sparks-notation/react-editor",
"version": "1.15.1",
"version": "1.15.2",
"description": "A natural text format for composing numbered music notation or guitar tabulate scores, formerly known as Sparks NMN.",
"main": "index.js",
"author": "yezhiyi9670 <[email protected]>",
Expand Down

0 comments on commit 58fed3f

Please sign in to comment.