Skip to content

Commit

Permalink
fix page margins settings
Browse files Browse the repository at this point in the history
  • Loading branch information
buggins committed Nov 14, 2014
1 parent c159100 commit 28811c4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion android/src/org/coolreader/crengine/BaseActivity.java
Expand Up @@ -325,7 +325,7 @@ public float getDiagonalInches()
}

public boolean isSmartphone() {
return diagonalInches <= 5.8;
return diagonalInches <= 6.2; //5.8;
}

private int densityDpi = 160;
Expand Down
4 changes: 2 additions & 2 deletions android/src/org/coolreader/crengine/OptionsDialog.java
Expand Up @@ -89,10 +89,10 @@ public static int findBacklightSettingIndex( int value ) {
80, 85, 90, 95, 100, 105, 110, 115, 120, 130, 140, 150, 160, 180, 200
};
int[] mMinSpaceWidths = new int[] {
50, 60, 70, 80, 90, 100
25, 30, 40, 50, 60, 70, 80, 90, 100
};
int[] mMargins = new int[] {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 20, 25, 30, 40, 50, 60, 80, 100, 200, 300
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 20, 25, 30, 40, 50, 60, 80, 100, 130, 150, 200, 300
};
double[] mGammas = new double[] {
0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.5, 1.9
Expand Down
2 changes: 1 addition & 1 deletion cr3qt/src/settings.cpp
Expand Up @@ -12,7 +12,7 @@
#endif
#include <QDir>

static int def_margins[] = { 0, 5, 8, 10, 15, 20, 25, 30 };
static int def_margins[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 20, 25, 30, 40, 50, 60 };
#define MAX_MARGIN_INDEX (sizeof(def_margins)/sizeof(int))

DECL_DEF_CR_FONT_SIZES;
Expand Down
4 changes: 2 additions & 2 deletions crengine/src/lvdocview.cpp
Expand Up @@ -5574,7 +5574,7 @@ void LVDocView::propsUpdateDefaults(CRPropRef props) {

static int def_status_line[] = { 0, 1, 2 };
props->limitValueList(PROP_STATUS_LINE, def_status_line, 3);
static int def_margin[] = {8, 0, 1, 2, 3, 4, 5, 8, 10, 12, 14, 15, 16, 20, 25, 30, 40, 50, 60, 80, 100, 130, 150, 200, 300};
static int def_margin[] = {8, 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 25, 30, 40, 50, 60, 80, 100, 130, 150, 200, 300};
props->limitValueList(PROP_PAGE_MARGIN_TOP, def_margin, sizeof(def_margin)/sizeof(int));
props->limitValueList(PROP_PAGE_MARGIN_BOTTOM, def_margin, sizeof(def_margin)/sizeof(int));
props->limitValueList(PROP_PAGE_MARGIN_LEFT, def_margin, sizeof(def_margin)/sizeof(int));
Expand Down Expand Up @@ -5776,7 +5776,7 @@ CRPropRef LVDocView::propsApply(CRPropRef props) {
== PROP_PAGE_MARGIN_LEFT || name == PROP_PAGE_MARGIN_RIGHT
|| name == PROP_PAGE_MARGIN_BOTTOM) {
int margin = props->getIntDef(name.c_str(), 8);
int maxmargin = (name == PROP_PAGE_MARGIN_LEFT || name == PROP_PAGE_MARGIN_RIGHT) ? m_dx / 3 : m_dy / 3;
int maxmargin = (name == PROP_PAGE_MARGIN_LEFT || name == PROP_PAGE_MARGIN_RIGHT) ? m_dx / 4 : m_dy / 4;
if (margin > maxmargin)
margin = maxmargin;
lvRect rc = getPageMargins();
Expand Down
2 changes: 1 addition & 1 deletion crengine/src/lvtextfm.cpp
Expand Up @@ -972,7 +972,7 @@ class LVFormatter {
int spaceReduceWidth = 0; // max total line width which can be reduced by narrowing of spaces
int firstCharMargin = getAdditionalCharWidthOnLeft(pos); // for first italic char with elements below baseline
//spaceReduceWidth -= visialAlignmentWidth/2;
firstCharMargin += visialAlignmentWidth/2;
firstCharMargin += visialAlignmentWidth/3;
int visualAlignmentReserved = visialAlignmentWidth/2;
int spaceReduceCount = 0;
int maxSpaceReduceW = 0;
Expand Down

0 comments on commit 28811c4

Please sign in to comment.