|
@@ -15,10 +15,15 @@ object PdfMaker {
|
|
|
val width = 1920
|
|
|
val height = 1080
|
|
|
val coverWidth = width / 2
|
|
|
+ val coverFile = project.coverFile
|
|
|
emitter.onNext(progress++ / total)
|
|
|
val name = project.name ?: ""
|
|
|
val author = project.author ?: ""
|
|
|
- val front = CoverDrawer.drawFrontCover(coverWidth, height, name, author, project.frontCoverColor.getColor(context))
|
|
|
+ val front = if (coverFile == null) {
|
|
|
+ CoverDrawer.drawFrontCover(width, height, name, author, project.frontCoverColor.getColor(context))
|
|
|
+ } else {
|
|
|
+ CoverDrawer.drawFrontCover(width, height, name, author, coverFile)
|
|
|
+ }
|
|
|
emitter.onNext(progress++ / total)
|
|
|
val back = CoverDrawer.drawBackCover(context, coverWidth, height, project.backCoverColor.getColor(context))
|
|
|
emitter.onNext(progress++ / total)
|
|
@@ -41,9 +46,14 @@ object PdfMaker {
|
|
|
val height = 1080
|
|
|
val name = project.name ?: ""
|
|
|
val author = project.author ?: ""
|
|
|
+ val coverFile = project.coverFile
|
|
|
emitter.onNext(progress++ / total)
|
|
|
/** front **/
|
|
|
- val front = CoverDrawer.drawFrontCover(width, height, name, author, project.frontCoverColor.getColor(context))
|
|
|
+ val front = if (coverFile == null) {
|
|
|
+ CoverDrawer.drawFrontCover(width, height, name, author, project.frontCoverColor.getColor(context))
|
|
|
+ } else {
|
|
|
+ CoverDrawer.drawFrontCover(width, height, name, author, coverFile)
|
|
|
+ }
|
|
|
emitter.onNext(progress++ / total)
|
|
|
/** back **/
|
|
|
val back = CoverDrawer.drawBackCover(context, width, height, project.backCoverColor.getColor(context))
|