Bug fixing

This commit is contained in:
Alexei Anoshenko 2022-08-17 16:58:07 +03:00
parent 39a22905f0
commit 705a9c0e37
2 changed files with 21 additions and 5 deletions

View File

@ -672,11 +672,29 @@ func (style *viewStyle) transitionCSS(session Session) string {
buffer := allocStringBuilder()
defer freeStringBuilder(buffer)
convert := map[string]string{
CellHeight: "grid-template-rows",
CellWidth: "grid-template-columns",
Row: "grid-row",
Column: "grid-column",
Clip: "clip-path",
Shadow: "box-shadow",
ColumnSeparator: "column-rule",
FontName: "font",
TextSize: "font-size",
TextLineThickness: "text-decoration-thickness",
}
for tag, animation := range style.transitions {
if buffer.Len() > 0 {
buffer.WriteString(", ")
}
buffer.WriteString(tag)
if cssTag, ok := convert[tag]; ok {
buffer.WriteString(cssTag)
} else {
buffer.WriteString(tag)
}
animation.transitionCSS(buffer, session)
}
return buffer.String()

View File

@ -394,12 +394,10 @@ func (style *viewStyle) cssViewStyle(builder cssBuilder, session Session) {
}
if r, ok := rangeProperty(style, Row, session); ok {
builder.add("grid-row-start", strconv.Itoa(r.First+1))
builder.add("grid-row-end", strconv.Itoa(r.Last+2))
builder.add("grid-row", fmt.Sprintf("%d / %d", r.First+1, r.Last+2))
}
if r, ok := rangeProperty(style, Column, session); ok {
builder.add("grid-column-start", strconv.Itoa(r.First+1))
builder.add("grid-column-end", strconv.Itoa(r.Last+2))
builder.add("grid-column", fmt.Sprintf("%d / %d", r.First+1, r.Last+2))
}
if text := style.gridCellSizesCSS(CellWidth, session); text != "" {
builder.add(`grid-template-columns`, text)